Attempt to resolve NaN issue with unstable VAEs in fp32 mk2
This commit is contained in:
parent
541ef9247c
commit
3003b10e0a
|
@ -49,6 +49,7 @@ def samples_to_images_tensor(sample, approximation=None, model=None):
|
||||||
else:
|
else:
|
||||||
if model is None:
|
if model is None:
|
||||||
model = shared.sd_model
|
model = shared.sd_model
|
||||||
|
with devices.without_autocast(): # fixes an issue with unstable VAEs that are flaky even in fp32
|
||||||
x_sample = model.decode_first_stage(sample.to(model.first_stage_model.dtype))
|
x_sample = model.decode_first_stage(sample.to(model.first_stage_model.dtype))
|
||||||
|
|
||||||
return x_sample
|
return x_sample
|
||||||
|
|
Loading…
Reference in New Issue