Birch-san / sdxl-play

BSD 3-Clause "New" or "Revised" License
25 stars 2 forks source link

torch.manual_seed return is not assigned to a variable? #1

Closed bghira closed 6 months ago

bghira commented 1 year ago

Howdy, checking through your implementation with Diffusers and I noticed you're setting manual_seed but the returned torch.Generator isn't assigned to a value or passed into the refiner.

Birch-san commented 1 year ago

could you please tell me which file + line of code?

bghira commented 1 year ago

https://github.com/Birch-san/sdxl-play/blob/main/scripts/sdxl_diffusers_play.py#L139

Birch-san commented 1 year ago

that API call seeds the RNG for all devices in torch. it works due to side-effects. it’s not necessary to use the Generator it returns.

https://pytorch.org/docs/stable/notes/randomness.html#pytorch-random-number-generator