Skip to content

Commit

Permalink
Fix seed assignment for batch requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
FeepingCreature committed Aug 30, 2024
1 parent 9d0140e commit b63a992
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ai_diffusion/model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations
import asyncio
from copy import copy
from dataclasses import replace
from pathlib import Path
from enum import Enum
from typing import Any, NamedTuple
Expand Down Expand Up @@ -209,8 +210,8 @@ async def enqueue_jobs(
params.prompt = params.regions[0].prompt

for i in range(count):
sampling.seed = sampling.seed + i * settings.batch_size
params.seed = sampling.seed
input = replace(input, sampling=replace(sampling, seed=sampling.seed + i * settings.batch_size))
params.seed = input.sampling.seed

Check failure on line 214 in ai_diffusion/model.py

View workflow job for this annotation

GitHub Actions / check

"seed" is not a known attribute of "None" (reportOptionalMemberAccess)
job = self.jobs.add(kind, copy(params))
await self._enqueue_job(job, input)

Expand Down

0 comments on commit b63a992

Please sign in to comment.