mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-05-28 20:17:13 +08:00
Update nodes.py
This commit is contained in:
parent
cdf8ca8298
commit
ba33d02198
@ -2299,25 +2299,26 @@ def patched_load_lora_for_models(model, clip, lora, strength_model, strength_cli
|
|||||||
print("NOT LOADED {}".format(x))
|
print("NOT LOADED {}".format(x))
|
||||||
|
|
||||||
if patch_keys:
|
if patch_keys:
|
||||||
compile_settings = getattr(model.model, "compile_settings")
|
if hasattr(model.model, "compile_settings"):
|
||||||
print("compile_settings: ", compile_settings)
|
compile_settings = getattr(model.model, "compile_settings")
|
||||||
for k in patch_keys:
|
print("compile_settings: ", compile_settings)
|
||||||
if "diffusion_model." in k:
|
for k in patch_keys:
|
||||||
# Remove the prefix to get the attribute path
|
if "diffusion_model." in k:
|
||||||
key = k.replace('diffusion_model.', '')
|
# Remove the prefix to get the attribute path
|
||||||
attributes = key.split('.')
|
key = k.replace('diffusion_model.', '')
|
||||||
# Start with the diffusion_model object
|
attributes = key.split('.')
|
||||||
block = model.get_model_object("diffusion_model")
|
# Start with the diffusion_model object
|
||||||
# Navigate through the attributes to get to the block
|
block = model.get_model_object("diffusion_model")
|
||||||
for attr in attributes:
|
# Navigate through the attributes to get to the block
|
||||||
if attr.isdigit():
|
for attr in attributes:
|
||||||
block = block[int(attr)]
|
if attr.isdigit():
|
||||||
else:
|
block = block[int(attr)]
|
||||||
block = getattr(block, attr)
|
else:
|
||||||
# Compile the block
|
block = getattr(block, attr)
|
||||||
compiled_block = torch.compile(block, mode=compile_settings["mode"], dynamic=compile_settings["dynamic"], fullgraph=compile_settings["fullgraph"], backend=compile_settings["backend"])
|
# Compile the block
|
||||||
# Add the compiled block back as an object patch
|
compiled_block = torch.compile(block, mode=compile_settings["mode"], dynamic=compile_settings["dynamic"], fullgraph=compile_settings["fullgraph"], backend=compile_settings["backend"])
|
||||||
model.add_object_patch(k, compiled_block)
|
# Add the compiled block back as an object patch
|
||||||
|
model.add_object_patch(k, compiled_block)
|
||||||
return (new_modelpatcher, new_clip)
|
return (new_modelpatcher, new_clip)
|
||||||
|
|
||||||
def patched_write_atomic(
|
def patched_write_atomic(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user