Expose long-text fields as input sockets (forceInput)
axes, reference_description, system_prompt, user_prompt now render as INPUT SOCKETS (forceInput) so they can be wired from other nodes — e.g. describe's canonical output -> compare's reference_description, or a text node -> chat prompts. Small config (report_dir, run_tag, model_path, ...) stays as typeable fields. Unconnected sockets fall back to sensible defaults; the agent/bridge can still set them by value via the API. Dropped the now-socket fields from the example workflows; bumped their max_new_tokens to 2048. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+12
-12
@@ -795,34 +795,34 @@ class QwenVLImageJudge:
|
||||
{"default": list(MODEL_PRESETS.keys())[0]}),
|
||||
"model_path": ("STRING", {"default": ""}), # manual override (local dir / HF repo / alias)
|
||||
"precision": (["bf16", "fp8", "nf4"], {"default": "bf16"}),
|
||||
"axes": ("STRING", {"default": "", "multiline": True}),
|
||||
"max_new_tokens": ("INT", {"default": 2048, "min": 64, "max": 8192}),
|
||||
"temperature": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1.5, "step": 0.05}),
|
||||
"swap_eval": ("BOOLEAN", {"default": True}),
|
||||
"keep_loaded": ("BOOLEAN", {"default": True}),
|
||||
"auto_download": ("BOOLEAN", {"default": True}),
|
||||
# The agent reads the analysis from these files after each queue.
|
||||
# Small config values stay as typeable fields.
|
||||
"report_dir": ("STRING", {"default": ""}),
|
||||
"run_tag": ("STRING", {"default": ""}),
|
||||
# compare: canonical reference text (from describe). When set, compare
|
||||
# anchors on it instead of re-reading the reference image each time.
|
||||
"reference_description": ("STRING", {"default": "", "multiline": True}),
|
||||
# chat mode: use the node as a general VLM with your own prompts.
|
||||
"system_prompt": ("STRING", {"default": "", "multiline": True}),
|
||||
"user_prompt": ("STRING", {"default": "Describe this image.", "multiline": True}),
|
||||
},
|
||||
# Only genuine node-to-node wires stay optional (widgets in `optional` render
|
||||
# as input sockets instead of editable fields in some ComfyUI frontends).
|
||||
# Long text content is exposed as INPUT SOCKETS (forceInput) so it can be wired
|
||||
# from other nodes — e.g. describe's canonical output -> reference_description, a
|
||||
# text node -> system_prompt/user_prompt. Left unconnected, sensible defaults apply
|
||||
# (empty axes -> profile; empty reference_description -> two-image compare). The
|
||||
# agent/bridge can still set them by value via the API.
|
||||
"optional": {
|
||||
"generated_image": ("IMAGE",), # required for compare, ignored for describe/chat
|
||||
"axes": ("STRING", {"forceInput": True}),
|
||||
"reference_description": ("STRING", {"forceInput": True}),
|
||||
"system_prompt": ("STRING", {"forceInput": True}),
|
||||
"user_prompt": ("STRING", {"forceInput": True}),
|
||||
},
|
||||
}
|
||||
|
||||
def judge(self, reference_image, mode, model_path, precision, axes,
|
||||
def judge(self, reference_image, mode, model_path, precision,
|
||||
max_new_tokens, temperature, swap_eval, profile="general",
|
||||
model_select=MANUAL_CHOICE, generated_image=None,
|
||||
keep_loaded=True, auto_download=True,
|
||||
report_dir="", run_tag="", reference_description="",
|
||||
report_dir="", run_tag="", axes="", reference_description="",
|
||||
system_prompt="", user_prompt="Describe this image."):
|
||||
# `axes` overrides the profile when provided; otherwise use the profile's axis set.
|
||||
axis_list = [a.strip() for a in re.split(r"[,\n]", axes) if a.strip()]
|
||||
|
||||
Reference in New Issue
Block a user