mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-18 01:53:31 +00:00
fix the issue for model first inference with lora
This commit is contained in:
parent
77e9294c08
commit
ebfe7a5679
@ -463,21 +463,13 @@ class ModelPatcher:
|
|||||||
key = k[0]
|
key = k[0]
|
||||||
if len(k) > 2:
|
if len(k) > 2:
|
||||||
function = k[2]
|
function = k[2]
|
||||||
|
org_key=key.replace("diffusion_model", "diffusion_model._orig_mod")
|
||||||
if key in model_sd:
|
if key in model_sd or org_key in model_sd:
|
||||||
p.add(k)
|
p.add(k)
|
||||||
current_patches = self.patches.get(key, [])
|
current_patches = self.patches.get(key, [])
|
||||||
current_patches.append((strength_patch, patches[k], strength_model, offset, function))
|
current_patches.append((strength_patch, patches[k], strength_model, offset, function))
|
||||||
self.patches[key] = current_patches
|
self.patches[key] = current_patches
|
||||||
else:
|
self.patches[org_key] = current_patches
|
||||||
new_key=key.replace("diffusion_model", "diffusion_model._orig_mod")
|
|
||||||
if new_key in model_sd:
|
|
||||||
p.add(k)
|
|
||||||
if key in self.patches:
|
|
||||||
self.patches.pop(key)
|
|
||||||
current_patches = self.patches.get(new_key, [])
|
|
||||||
current_patches.append((strength_patch, patches[k], strength_model, offset, function))
|
|
||||||
self.patches[new_key] = current_patches
|
|
||||||
|
|
||||||
self.patches_uuid = uuid.uuid4()
|
self.patches_uuid = uuid.uuid4()
|
||||||
return list(p)
|
return list(p)
|
||||||
|
Loading…
Reference in New Issue
Block a user