mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-02-09 17:39:59 +00:00
i
This commit is contained in:
@@ -653,6 +653,12 @@ def load_model(checkpoint_info=None, already_loaded_state_dict=None):
|
||||
timer.record("create unet patcher")
|
||||
del state_dict_for_forge
|
||||
|
||||
def patched_decode_first_stage(sample):
|
||||
sample = unet_patcher.model.model_config.latent_format.process_out(sample)
|
||||
return vae_patcher.decode(sample).movedim(-1, 1) * 2.0 - 1.0
|
||||
|
||||
sd_model.decode_first_stage = patched_decode_first_stage
|
||||
|
||||
load_model_weights(sd_model, checkpoint_info, state_dict_for_a1111, timer)
|
||||
del state_dict_for_a1111
|
||||
timer.record("load weights from state dict")
|
||||
|
||||
@@ -52,8 +52,7 @@ def samples_to_images_tensor(sample, approximation=None, model=None):
|
||||
else:
|
||||
if model is None:
|
||||
model = shared.sd_model
|
||||
sample = model.unet_patcher.model.model_config.latent_format.process_out(sample)
|
||||
x_sample = model.vae_patcher.decode(sample).movedim(-1, 1) * 2.0 - 1.0
|
||||
x_sample = model.decode_first_stage(sample)
|
||||
|
||||
return x_sample
|
||||
|
||||
|
||||
Reference in New Issue
Block a user