mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-04 11:12:35 +00:00
Option to use CPU for random number generation.
Makes a given manual seed generate the same images across different platforms, independently of the GPU architecture in use. Fixes #9613.
This commit is contained in:
@@ -190,7 +190,7 @@ class TorchHijack:
|
||||
if noise.shape == x.shape:
|
||||
return noise
|
||||
|
||||
if x.device.type == 'mps':
|
||||
if opts.use_cpu_randn or x.device.type == 'mps':
|
||||
return torch.randn_like(x, device=devices.cpu).to(x.device)
|
||||
else:
|
||||
return torch.randn_like(x)
|
||||
|
Reference in New Issue
Block a user