mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
fix support for 2.0 inpainting model while maintaining support for 1.5 inpainting model
This commit is contained in:
parent
a1c8ad8828
commit
bd81a09eac
@ -324,12 +324,11 @@ def should_hijack_inpainting(checkpoint_info):
|
|||||||
|
|
||||||
def do_inpainting_hijack():
|
def do_inpainting_hijack():
|
||||||
# most of this stuff seems to no longer be needed because it is already included into SD2.0
|
# most of this stuff seems to no longer be needed because it is already included into SD2.0
|
||||||
# LatentInpaintDiffusion remains because SD2.0's LatentInpaintDiffusion can't be loaded without specifying a checkpoint
|
|
||||||
# p_sample_plms is needed because PLMS can't work with dicts as conditionings
|
# p_sample_plms is needed because PLMS can't work with dicts as conditionings
|
||||||
# this file should be cleaned up later if weverything tuens out to work fine
|
# this file should be cleaned up later if weverything tuens out to work fine
|
||||||
|
|
||||||
# ldm.models.diffusion.ddpm.get_unconditional_conditioning = get_unconditional_conditioning
|
# ldm.models.diffusion.ddpm.get_unconditional_conditioning = get_unconditional_conditioning
|
||||||
ldm.models.diffusion.ddpm.LatentInpaintDiffusion = LatentInpaintDiffusion
|
# ldm.models.diffusion.ddpm.LatentInpaintDiffusion = LatentInpaintDiffusion
|
||||||
|
|
||||||
# ldm.models.diffusion.ddim.DDIMSampler.p_sample_ddim = p_sample_ddim
|
# ldm.models.diffusion.ddim.DDIMSampler.p_sample_ddim = p_sample_ddim
|
||||||
# ldm.models.diffusion.ddim.DDIMSampler.sample = sample_ddim
|
# ldm.models.diffusion.ddim.DDIMSampler.sample = sample_ddim
|
||||||
|
@ -296,6 +296,7 @@ def load_model(checkpoint_info=None):
|
|||||||
sd_config.model.params.use_ema = False
|
sd_config.model.params.use_ema = False
|
||||||
sd_config.model.params.conditioning_key = "hybrid"
|
sd_config.model.params.conditioning_key = "hybrid"
|
||||||
sd_config.model.params.unet_config.params.in_channels = 9
|
sd_config.model.params.unet_config.params.in_channels = 9
|
||||||
|
sd_config.model.params.finetune_keys = None
|
||||||
|
|
||||||
# Create a "fake" config with a different name so that we know to unload it when switching models.
|
# Create a "fake" config with a different name so that we know to unload it when switching models.
|
||||||
checkpoint_info = checkpoint_info._replace(config=checkpoint_info.config.replace(".yaml", "-inpainting.yaml"))
|
checkpoint_info = checkpoint_info._replace(config=checkpoint_info.config.replace(".yaml", "-inpainting.yaml"))
|
||||||
|
Loading…
Reference in New Issue
Block a user