Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/huggingface_inference_toolkit/diffusers_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ def __call__(
prompt,
**kwargs,
):
# diffusers doesn't support seed but rather the generator kwarg

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@ErikKaum ErikKaum Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah lol, I just merged and after that this comment popped up. But I'll add it in a separate PR. I think it's a good idea to have the "paper trace"

if "seed" in kwargs:
seed = int(kwargs["seed"])
generator = torch.Generator().manual_seed(seed)
kwargs["generator"] = generator
kwargs.pop("seed")

# TODO: add support for more images (Reason is correct output)
if "num_images_per_prompt" in kwargs:
kwargs.pop("num_images_per_prompt")
Expand Down
Loading