Merge pull request #35 from TheBill2001/master
Fix for Execution Model Inversion
This commit is contained in:
+4
-3
@@ -7,6 +7,7 @@ from .defs.meta import MetaField
|
||||
|
||||
from nodes import NODE_CLASS_MAPPINGS
|
||||
from execution import get_input_data
|
||||
from comfy_execution.graph import DynamicPrompt
|
||||
|
||||
|
||||
class Capture:
|
||||
@@ -15,14 +16,14 @@ class Capture:
|
||||
inputs = {}
|
||||
prompt = hook.current_prompt
|
||||
extra_data = hook.current_extra_data
|
||||
outputs = hook.prompt_executer.outputs
|
||||
outputs = hook.prompt_executer.caches.outputs
|
||||
|
||||
for node_id, obj in prompt.items():
|
||||
class_type = obj["class_type"]
|
||||
obj_class = NODE_CLASS_MAPPINGS[class_type]
|
||||
node_inputs = prompt[node_id]["inputs"]
|
||||
input_data = get_input_data(
|
||||
node_inputs, obj_class, node_id, outputs, prompt, extra_data
|
||||
node_inputs, obj_class, node_id, outputs, DynamicPrompt(prompt), extra_data
|
||||
)
|
||||
for node_class, metas in CAPTURE_FIELD_LIST.items():
|
||||
if class_type == node_class:
|
||||
@@ -54,7 +55,7 @@ class Capture:
|
||||
continue
|
||||
|
||||
field_name = field_data["field_name"]
|
||||
value = input_data.get(field_name)
|
||||
value = input_data[0].get(field_name)
|
||||
if value is not None:
|
||||
format = field_data.get("format")
|
||||
v = value
|
||||
|
||||
@@ -17,22 +17,22 @@ def get_lora_model_hash_stack(node_id, obj, prompt, extra_data, outputs, input_d
|
||||
def get_lora_strength_model_stack(
|
||||
node_id, obj, prompt, extra_data, outputs, input_data
|
||||
):
|
||||
if input_data["input_mode"][0] == "advanced":
|
||||
if input_data[0]["input_mode"][0] == "advanced":
|
||||
return get_lora_data_stack(input_data, "model_str")
|
||||
return get_lora_data_stack(input_data, "lora_wt")
|
||||
|
||||
|
||||
def get_lora_strength_clip_stack(node_id, obj, prompt, extra_data, outputs, input_data):
|
||||
if input_data["input_mode"][0] == "advanced":
|
||||
if input_data[0]["input_mode"][0] == "advanced":
|
||||
return get_lora_data_stack(input_data, "clip_str")
|
||||
return get_lora_data_stack(input_data, "lora_wt")
|
||||
|
||||
|
||||
def get_lora_data_stack(input_data, attribute):
|
||||
lora_count = input_data["lora_count"][0]
|
||||
lora_count = input_data[0]["lora_count"][0]
|
||||
return [
|
||||
v[0]
|
||||
for k, v in input_data.items()
|
||||
for k, v in input_data[0].items()
|
||||
if k.startswith(attribute) and v[0] != "None"
|
||||
][:lora_count]
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ def get_lora_strength(node_id, obj, prompt, extra_data, outputs, input_data):
|
||||
def get_lora_data(input_data, attribute):
|
||||
return [
|
||||
v[0][attribute]
|
||||
for k, v in input_data.items()
|
||||
for k, v in input_data[0].items()
|
||||
if k.startswith("lora_") and v[0]["on"]
|
||||
]
|
||||
|
||||
@@ -44,7 +44,7 @@ def get_lora_strength_stack(node_id, obj, prompt, extra_data, outputs, input_dat
|
||||
def get_lora_data_stack(input_data, attribute):
|
||||
return [
|
||||
v[0]
|
||||
for k, v in input_data.items()
|
||||
for k, v in input_data[0].items()
|
||||
if k.startswith(attribute + "_") and v[0] != "None"
|
||||
]
|
||||
|
||||
|
||||
@@ -38,12 +38,12 @@ def convert_skip_clip(stop_at_clip_layer, input_data):
|
||||
|
||||
|
||||
def get_scaled_width(scaled_by, input_data):
|
||||
samples = input_data["samples"][0]["samples"]
|
||||
samples = input_data[0]["samples"][0]["samples"]
|
||||
return round(samples.shape[3] * scaled_by * 8)
|
||||
|
||||
|
||||
def get_scaled_height(scaled_by, input_data):
|
||||
samples = input_data["samples"][0]["samples"]
|
||||
samples = input_data[0]["samples"][0]["samples"]
|
||||
return round(samples.shape[2] * scaled_by * 8)
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ def extract_embedding_hashes(text, input_data):
|
||||
|
||||
|
||||
def _extract_embedding_names(text, input_data):
|
||||
clip = input_data["clip"][0]
|
||||
clip = input_data[0]["clip"][0]
|
||||
tokenizer = clip.tokenizer
|
||||
if isinstance(tokenizer, SD1Tokenizer):
|
||||
tokenizer = tokenizer.clip_l
|
||||
|
||||
Reference in New Issue
Block a user