add NV option for Random number generator source setting, which allows to generate same pictures on CPU/AMD/Mac as on NVidia videocards.

This commit is contained in:
AUTOMATIC1111
2023-08-03 00:00:23 +03:00
parent ccb9233934
commit 84b6fcd02c
5 changed files with 142 additions and 10 deletions

View File

@@ -260,10 +260,7 @@ class TorchHijack:
if noise.shape == x.shape:
return noise
if opts.randn_source == "CPU" or x.device.type == 'mps':
return torch.randn_like(x, device=devices.cpu).to(x.device)
else:
return torch.randn_like(x)
return devices.randn_like(x)
class KDiffusionSampler: