mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-03-02 19:49:48 +00:00
Update forge_loader.py
This commit is contained in:
@@ -232,10 +232,13 @@ def load_model_for_a1111(timer, checkpoint_info=None, state_dict=None):
|
||||
|
||||
def patched_encode_first_stage(x):
|
||||
sample = forge_objects.vae.encode(x.movedim(1, -1) * 0.5 + 0.5)
|
||||
sample = forge_objects.unet.model.model_config.latent_format.process_in(sample)
|
||||
return sample.to(x)
|
||||
|
||||
sd_model.get_first_stage_encoding = lambda x: x
|
||||
def patched_get_first_stage_encoding(x):
|
||||
sample = forge_objects.unet.model.model_config.latent_format.process_in(x)
|
||||
return sample.to(x)
|
||||
|
||||
sd_model.get_first_stage_encoding = patched_get_first_stage_encoding
|
||||
sd_model.decode_first_stage = patched_decode_first_stage
|
||||
sd_model.encode_first_stage = patched_encode_first_stage
|
||||
|
||||
|
||||
Reference in New Issue
Block a user