mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-09-30 23:35:33 -03:00
fix(nodes): let Load Image Metadata value outputs drive dropdown widgets
model_name, sampler_name and scheduler were declared as COMBO outputs, so the
documented wiring failed at queue time with "Return type mismatch between linked
nodes". ComfyUI only accepts a COMBO output into a node that declares its
dropdown as COMBO/IO.Combo, while Load Checkpoint, KSampler and the LoRA Manager
loaders expose their options as a plain list; comfy_execution.validation rejects
any non-string input type there, and a STRING output is rejected the same way.
Declare the three sockets untyped ("*"), the type ComfyUI's own Primitive node
uses to feed widget inputs. Verified with execution.validate_inputs that they now
link into both classic list dropdowns and IO.Combo inputs.
Also corrects the wiring guide, which claimed COMBO was the supported type.
This commit is contained in:
@@ -24,11 +24,16 @@ this change and refresh the page. This Python node needs no Vue widget build.
|
|||||||
model/LoRA names, local resolution status and warnings. The original `report`
|
model/LoRA names, local resolution status and warnings. The original `report`
|
||||||
output remains notes followed by formatted JSON; it is not a pure JSON string.
|
output remains notes followed by formatted JSON; it is not a pure JSON string.
|
||||||
|
|
||||||
`model_name`, `sampler_name`, and `scheduler` use COMBO outputs for converted
|
`model_name`, `sampler_name`, and `scheduler` are declared as untyped (`*`)
|
||||||
dropdown inputs in current ComfyUI. `model_name` contains the matching local
|
outputs so they can feed the dropdown widget inputs on both
|
||||||
checkpoint or diffusion-model filename. The report identifies the resolved type;
|
**Load Checkpoint**/**KSampler** and the LoRA Manager loaders. Typing them
|
||||||
connect it to the appropriate loader. Lookup searches both categories regardless
|
`COMBO` does not work: ComfyUI only accepts a `COMBO` output into a node that
|
||||||
of how the original metadata labels the model.
|
declares its dropdown as `COMBO`/`IO.Combo`, while classic dropdowns expose a
|
||||||
|
plain option list, and the server rejects the link with "Return type mismatch
|
||||||
|
between linked nodes". `model_name` contains the matching local checkpoint or
|
||||||
|
diffusion-model filename. The report identifies the resolved type; connect it to
|
||||||
|
the appropriate loader. Lookup searches both categories regardless of how the
|
||||||
|
original metadata labels the model.
|
||||||
|
|
||||||
For a diffusion-model workflow, connect `model_name` to **Unet Loader
|
For a diffusion-model workflow, connect `model_name` to **Unet Loader
|
||||||
(LoraManager)** and select the correct text encoder(s), VAE, latent node and
|
(LoraManager)** and select the correct text encoder(s), VAE, latent node and
|
||||||
|
|||||||
@@ -118,9 +118,16 @@ class LoadImageMetadataLM:
|
|||||||
"Connect lora_stack to Lora Loader. Convert loader/sampler widgets to inputs for the other outputs. "
|
"Connect lora_stack to Lora Loader. Convert loader/sampler widgets to inputs for the other outputs. "
|
||||||
"Extraction failures use starter defaults and are shown as ERROR messages in readable_report."
|
"Extraction failures use starter defaults and are shown as ERROR messages in readable_report."
|
||||||
)
|
)
|
||||||
|
# model_name, sampler_name and scheduler select a value from a loader or
|
||||||
|
# sampler dropdown. They must stay untyped (Any, "*"): ComfyUI rejects a
|
||||||
|
# "COMBO" (and a "STRING") output linked into the classic list-style combo
|
||||||
|
# inputs used by Load Checkpoint, KSampler, and the LoRA Manager loaders
|
||||||
|
# (comfy_execution/validation.py refuses a non-string input type), which
|
||||||
|
# surfaced as "Return type mismatch between linked nodes" at queue time.
|
||||||
|
# "*" is the same type ComfyUI's own Primitive node uses to feed widgets.
|
||||||
RETURN_TYPES = (
|
RETURN_TYPES = (
|
||||||
"IMAGE", "MASK", "STRING", "STRING", "COMBO", "LORA_STACK", "STRING",
|
"IMAGE", "MASK", "STRING", "STRING", "*", "LORA_STACK", "STRING",
|
||||||
"INT", "INT", "FLOAT", "COMBO", "COMBO", "INT", "INT", "FLOAT", "STRING", "STRING", "STRING",
|
"INT", "INT", "FLOAT", "*", "*", "INT", "INT", "FLOAT", "STRING", "STRING", "STRING",
|
||||||
)
|
)
|
||||||
RETURN_NAMES = (
|
RETURN_NAMES = (
|
||||||
"image", "mask", "positive", "negative", "model_name", "lora_stack", "lora_stack_text",
|
"image", "mask", "positive", "negative", "model_name", "lora_stack", "lora_stack_text",
|
||||||
|
|||||||
@@ -61,6 +61,22 @@ def test_full_node_contract_with_real_png_metadata(runtime):
|
|||||||
assert LoadImageMetadataLM.INPUT_TYPES()["required"]["image"][1]["image_upload"]
|
assert LoadImageMetadataLM.INPUT_TYPES()["required"]["image"][1]["image_upload"]
|
||||||
|
|
||||||
|
|
||||||
|
def test_value_selector_outputs_stay_untyped():
|
||||||
|
"""These sockets must not be typed COMBO/STRING.
|
||||||
|
|
||||||
|
Load Checkpoint, KSampler and the LoRA Manager loaders declare their name
|
||||||
|
dropdowns as plain option lists ("classic" combos). ComfyUI's
|
||||||
|
comfy_execution.validation rejects any non-string input type for those, so a
|
||||||
|
COMBO (or STRING) output linked into them fails at queue time with
|
||||||
|
"Return type mismatch between linked nodes". Only an untyped ("*") output
|
||||||
|
works, which is also what ComfyUI's own Primitive node uses for widgets.
|
||||||
|
"""
|
||||||
|
types = LoadImageMetadataLM.RETURN_TYPES
|
||||||
|
names = LoadImageMetadataLM.RETURN_NAMES
|
||||||
|
for output in ("model_name", "sampler_name", "scheduler"):
|
||||||
|
assert types[names.index(output)] == "*", output
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("extension", ["webp", "jpg"])
|
@pytest.mark.parametrize("extension", ["webp", "jpg"])
|
||||||
def test_exif_parameters_from_real_image(runtime, extension):
|
def test_exif_parameters_from_real_image(runtime, extension):
|
||||||
image_path, *_ = runtime
|
image_path, *_ = runtime
|
||||||
|
|||||||
Reference in New Issue
Block a user