mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
css fixes
This commit is contained in:
@@ -45,6 +45,7 @@ def single_sample_to_image(sample, approximation=None):
|
||||
x_sample = x_sample[[2,1,0],:,:] # BGR to RGB
|
||||
elif approximation == 2: # TAESD
|
||||
x_sample = sd_vae_taesd.decode(sample)
|
||||
x_sample = (1.0 + x_sample) / 2.0 # preview requires smaller range
|
||||
elif approximation == 3: # Full VAE
|
||||
x_sample = processing.decode_first_stage(shared.sd_model, sample.unsqueeze(0))[0] * 0.5 + 0.5
|
||||
else:
|
||||
|
||||
@@ -60,7 +60,7 @@ def decode(latents):
|
||||
vae.to(devices.device, devices.dtype_vae)
|
||||
enc = latents.unsqueeze(0).to(devices.device, devices.dtype_vae)
|
||||
image = vae.decoder(enc).clamp(0, 1).detach()
|
||||
image = 2.0 * image - 1.0
|
||||
image = 2.0 * image - 1.0 # typical normalized range except for preview which runs denormalization
|
||||
return image[0]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user