Skip to content

Commit

Permalink
fix sample image generation without seed failed close #1726
Browse files Browse the repository at this point in the history
  • Loading branch information
kohya-ss committed Oct 26, 2024
1 parent 56bf761 commit 014064f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/sd3_train_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ def do_sample(
# noise = get_noise(seed, latent).to(device)
if seed is not None:
generator = torch.manual_seed(seed)
else:
generator = None
noise = (
torch.randn(latent.size(), dtype=torch.float32, layout=latent.layout, generator=generator, device="cpu")
.to(latent.dtype)
Expand Down

0 comments on commit 014064f

Please sign in to comment.