Compare commits

...
Author SHA1 Message Date
0031a897d7 fix(HEL-623): split dual-prompt text encoders; positive wiring wins; detect duration via expression
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-09-28 18:57:00 +08:00
shigongyuan-agentandmultica-agent 063a3c7063 fix: untagged ComfyUI workflows expose inputs; studio generate always gives feedback (HEL-623)
Root cause: parse_dynamic_inputs only recognised (Input:role) title tags.
A workflow exported straight from ComfyUI has default titles, so its
input_schema was empty and the studio form rendered no prompt box; the
generate click then enqueued (or was blocked) with no toast at all.

- parser: untagged fallback detects prompt/negative (via wiring to
  sampler positive/negative), seed/steps/cfg, latent width/height/batch,
  numeric primitives, LoadImage/LoadImageMask/video/audio slots; only the
  prompt is required; entries carry auto=true
- patcher: "<nodeId>@<widget>" keys target one widget on multi-widget
  nodes, never overwrite linked inputs; LoadImageMask uploads like images
- workflows API re-derives an empty stored schema (old imports fixed
  without re-import); smart_fill sort accepts subgraph/field ids
- studio: blocked submit toasts the reason and scrolls to the field;
  success toasts "已提交"; submit errors show the API detail; job.failed
  for this window's jobs toasts the reason; no-param workflows show a
  note + disabled prompt box; auto-detected params show a note
- connections import: chip shows node count, toast reports real params
- Chinese messages for ComfyUI rejection/upload/timeout/execution errors
  and playground workflow-not-found/disabled
- tests: native Qwen t2i / Qwen edit+mask / untagged H3 fixtures, patch
  keys, backfill, full fake-ComfyUI chain, Chinese rejection

Co-authored-by: multica-agent <github@multica.ai>
2026-09-28 18:25:41 +08:00
27 changed files with 2310 additions and 35 deletions
@@ -46,10 +46,10 @@ def _surface_error(prefix: str, resp: httpx.Response) -> RuntimeError:
if isinstance(e, dict):
msg = e.get("message") or e.get("details")
if msg:
parts.append(f"node {node_id}: {msg}")
detail = "; ".join(parts)
suffix = f": {detail}" if detail else ""
return RuntimeError(f"{prefix} ({resp.status_code}){suffix}")
parts.append(f"节点 {node_id}:{msg}")
detail = ";".join(parts)
suffix = f":{detail}" if detail else ""
return RuntimeError(f"{prefix}(HTTP {resp.status_code}){suffix}")
class ComfyUIClient:
@@ -75,7 +75,7 @@ class ComfyUIClient:
form = {"overwrite": "true", "subfolder": subfolder}
resp = await self._http.post(f"{self.base_url}/upload/image", files=files, data=form)
if resp.status_code >= 400:
raise _surface_error("ComfyUI image upload failed", resp)
raise _surface_error("图片上传到 ComfyUI 失败", resp)
result = resp.json()
name = result.get("name", path.name)
sub = result.get("subfolder") or subfolder
@@ -95,7 +95,7 @@ class ComfyUIClient:
form["subfolder"] = subfolder
resp = await self._http.post(f"{self.base_url}/upload/image", files=files, data=form)
if resp.status_code >= 400:
raise _surface_error("ComfyUI audio upload failed", resp)
raise _surface_error("音频上传到 ComfyUI 失败", resp)
result = resp.json()
name = result.get("name", path.name)
sub = result.get("subfolder") or subfolder
@@ -108,7 +108,7 @@ class ComfyUIClient:
form = {"overwrite": "true", "subfolder": subfolder, "type": "input"}
resp = await self._http.post(f"{self.base_url}/upload/image", files=files, data=form)
if resp.status_code >= 400:
raise _surface_error("ComfyUI video upload failed", resp)
raise _surface_error("视频上传到 ComfyUI 失败", resp)
result = resp.json()
name = result.get("name", path.name)
sub = result.get("subfolder") or subfolder
@@ -202,11 +202,13 @@ class ComfyUIClient:
payload = {"prompt": workflow, "client_id": self.client_id}
resp = await self._http.post(f"{self.base_url}/prompt", json=payload)
if resp.status_code >= 400:
raise _surface_error("ComfyUI rejected the workflow", resp)
raise _surface_error(
"ComfyUI 拒绝执行该工作流(常见原因:缺少模型/自定义节点,或参数不合法)", resp
)
data = resp.json()
prompt_id = data.get("prompt_id")
if not prompt_id:
raise RuntimeError(f"ComfyUI /prompt missing prompt_id: {data}")
raise RuntimeError(f"ComfyUI 返回异常:/prompt 响应缺少 prompt_id({str(data)[:200]})")
return prompt_id
async def get_history(self, prompt_id: str) -> dict[str, Any] | None:
+315 -2
View File
@@ -1,13 +1,15 @@
"""Parse ComfyUI API-format workflows for (Input[:role]) / (Output[:role]) titled nodes."""
from __future__ import annotations
from typing import Any
from calliope.comfyui.patcher import FIELD_KEY_SEP, resolve_patch_field
from calliope.comfyui.registry import (
ComfyOutputKind,
IMAGE_CLASSES,
AUDIO_CLASSES,
IMAGE_CLASSES,
VIDEO_CLASSES,
ComfyOutputKind,
class_to_input_kind,
class_to_output_kind,
)
@@ -36,6 +38,12 @@ def extract_default_value(node: dict[str, Any]) -> str | int | float | None:
def parse_dynamic_inputs(workflow: dict[str, Any]) -> list[dict[str, Any]]:
"""Tagged ``(Input:role)`` nodes; untagged workflows fall back to detection.
A workflow exported straight from ComfyUI carries default node titles
("CLIP Text Encode (Positive Prompt)", "KSampler", …) and no tags at all —
without the fallback it would expose nothing to fill in.
"""
results: list[dict[str, Any]] = []
for node_id, node in workflow.items():
if not isinstance(node, dict):
@@ -54,9 +62,314 @@ def parse_dynamic_inputs(workflow: dict[str, Any]) -> list[dict[str, Any]]:
"required": True,
}
)
if not results:
results = detect_untagged_inputs(workflow)
return results
# ---------------------------------------------------------------------------
# Untagged detection
# ---------------------------------------------------------------------------
_MASK_IMAGE_CLASSES = frozenset({"LoadImageMask"})
_STRING_PRIMITIVES = frozenset({"PrimitiveString", "PrimitiveStringMultiline"})
_NUMBER_PRIMITIVES = frozenset({"PrimitiveInt", "PrimitiveFloat", "INT", "FLOAT"})
_SAMPLER_CLASSES = frozenset({"KSampler", "KSamplerAdvanced"})
_NEGATIVE_WORDS = ("negative", "负面", "反向", "反面")
_SYSTEM_WORDS = ("system", "系统")
_PROMPT_WORDS = ("prompt", "positive", "提示", "正向")
_NEGATIVE_TEXT_FIELDS = ("negative_prompt", "negative_text", "negative")
# Title keyword → (role, Chinese label) for untagged numeric primitives.
_NUMBER_TITLE_ROLES: tuple[tuple[tuple[str, ...], str, str], ...] = (
(("duration", "seconds", "second", "时长", "秒"), "duration", "时长(秒)"),
(("fps", "frame rate", "framerate", "帧率"), "fps", "帧率"),
(("seed", "种子"), "seed", "随机种子"),
(("width", "宽度"), "width", "宽度"),
(("height", "高度"), "height", "高度"),
(("steps", "步数"), "steps", "采样步数"),
(("cfg",), "cfg", "CFG"),
)
def _is_scalar(value: Any) -> bool:
return isinstance(value, (str, int, float)) and not isinstance(value, bool)
def _title_of(node: dict[str, Any]) -> str:
return str((node.get("_meta") or {}).get("title") or "").strip()
def _node_sort_key(node_id: str) -> tuple:
return tuple(
(0, int(p)) if p.isdigit() else (1, p)
for p in str(node_id).replace(FIELD_KEY_SEP, ":").split(":")
)
def _consumers(workflow: dict[str, Any]) -> dict[str, list[tuple[str, str]]]:
"""source nodeId → [(consumer nodeId, consumer input name), …]."""
out: dict[str, list[tuple[str, str]]] = {}
for nid, node in workflow.items():
if not isinstance(node, dict):
continue
for name, val in (node.get("inputs") or {}).items():
if isinstance(val, list) and len(val) == 2 and isinstance(val[0], (str, int)):
out.setdefault(str(val[0]), []).append((str(nid), str(name)))
return out
def _feeds_negative(
node_id: str, consumers: dict[str, list[tuple[str, str]]], depth: int = 4
) -> bool:
"""True when this node's output reaches a sampler/guider ``negative`` input
and never a ``positive`` one.
A text encoder wired into both (one conditioning reused for positive and
negative) is treated as the positive prompt; only a negative-sounding
title makes it negative (see ``_is_negative``).
"""
frontier = [node_id]
seen = {node_id}
negative = False
for _ in range(depth):
nxt: list[str] = []
for nid in frontier:
for cid, name in consumers.get(nid, []):
if name == "positive":
return False
if name == "negative":
negative = True
continue
if cid not in seen:
seen.add(cid)
nxt.append(cid)
frontier = nxt
return negative
_FRAME_INPUTS = frozenset({"length", "num_frames", "frames", "video_length", "frame_count"})
_SECONDS_INPUTS = frozenset({"duration", "seconds", "duration_seconds"})
_EXPRESSION_HINTS = ("expression", "math")
def _duration_hint(
node_id: str,
workflow: dict[str, Any],
consumers: dict[str, list[tuple[str, str]]],
depth: int = 3,
) -> str | None:
"""How an untitled number feeds the video length downstream.
``"seconds"`` — it reaches a seconds input, or a frame-count input only
after passing through a math/expression node (seconds × fps → frames);
``"frames"`` — it is wired straight into a frame-count input.
"""
frontier = [(node_id, False)]
seen = {node_id}
for _ in range(depth):
nxt: list[tuple[str, bool]] = []
for nid, via_expr in frontier:
for cid, name in consumers.get(nid, []):
if name in _SECONDS_INPUTS:
return "seconds"
if name in _FRAME_INPUTS:
return "seconds" if via_expr else "frames"
if cid in seen:
continue
seen.add(cid)
ct = str((workflow.get(cid) or {}).get("class_type") or "").lower()
nxt.append((cid, via_expr or any(h in ct for h in _EXPRESSION_HINTS)))
frontier = nxt
return None
def _entry(
key: str, label: str, role: str | None, kind: str, default: Any, required: bool
) -> dict[str, Any]:
return {
"nodeId": key,
"label": label,
"role": role,
"kind": kind,
"defaultValue": default if _is_scalar(default) else None,
"required": required,
"auto": True,
}
def _key(node_id: str, node: dict[str, Any], field: str) -> str:
"""Plain nodeId when that already patches ``field``; else ``nodeId@field``."""
return (
str(node_id) if resolve_patch_field(node) == field else f"{node_id}{FIELD_KEY_SEP}{field}"
)
def detect_untagged_inputs(workflow: dict[str, Any]) -> list[dict[str, Any]]:
"""Infer fillable inputs from node classes and wiring of an untagged workflow.
Only scalar widgets are exposed (linked inputs are wiring, not values).
The positive prompt is the only required field; everything else keeps the
workflow's own value when left blank.
"""
if not isinstance(workflow, dict):
return []
consumers = _consumers(workflow)
nodes = sorted(
((str(k), v) for k, v in workflow.items() if isinstance(v, dict)),
key=lambda kv: _node_sort_key(kv[0]),
)
texts: list[tuple[str, dict[str, Any], str, bool]] = [] # (id, node, field, negative)
media: list[dict[str, Any]] = []
numbers: list[dict[str, Any]] = []
taken_roles: set[str] = set()
def add_number(nid: str, node: dict[str, Any], field: str, role: str, label: str) -> None:
if role in taken_roles:
return
value = (node.get("inputs") or {}).get(field)
if not _is_scalar(value) or isinstance(value, str):
return
taken_roles.add(role)
numbers.append(_entry(_key(nid, node, field), label, role, "number", value, False))
for nid, node in nodes:
ct = str(node.get("class_type") or "")
inputs = node.get("inputs") or {}
title = _title_of(node)
lowered = title.lower()
if ct in IMAGE_CLASSES or ct in _MASK_IMAGE_CLASSES:
is_mask = ct in _MASK_IMAGE_CLASSES or "mask" in lowered or "遮罩" in lowered
label = title if title and title != ct else ("遮罩" if is_mask else "参考图")
if is_mask and "mask" not in label.lower() and "遮罩" not in label:
label = f"遮罩 · {label}"
has_default = isinstance(inputs.get("image"), str) and bool(inputs.get("image"))
media.append(
_entry(
_key(nid, node, "image"),
label,
"mask" if is_mask else "image",
"image",
None,
not has_default,
)
)
continue
if ct in VIDEO_CLASSES or ct in AUDIO_CLASSES:
kind = "video" if ct in VIDEO_CLASSES else "audio"
field = resolve_patch_field(node)
has_default = isinstance(inputs.get(field), str) and bool(inputs.get(field))
media.append(_entry(str(nid), title or ct, kind, kind, None, not has_default))
continue
if ct in _STRING_PRIMITIVES and isinstance(inputs.get("value"), str):
texts.append((nid, node, "value", _is_negative(nid, lowered, consumers)))
continue
if ct == "CLIPTextEncode" or "TextEncode" in ct:
field = next((f for f in ("text", "prompt") if isinstance(inputs.get(f), str)), None)
neg_field = next(
(f for f in _NEGATIVE_TEXT_FIELDS if isinstance(inputs.get(f), str)), None
)
if field and neg_field:
# One encoder carrying both prompts (TextEncodeQwenImage21…):
# its outputs feed positive *and* negative, so wiring says nothing.
texts.append((nid, node, field, False))
texts.append((nid, node, neg_field, True))
elif field:
texts.append((nid, node, field, _is_negative(nid, lowered, consumers)))
continue
if ct in _SAMPLER_CLASSES:
add_number(nid, node, "seed" if "seed" in inputs else "noise_seed", "seed", "随机种子")
add_number(nid, node, "steps", "steps", "采样步数")
add_number(nid, node, "cfg", "cfg", "CFG")
continue
if ct == "RandomNoise":
add_number(nid, node, "noise_seed", "seed", "随机种子")
continue
if ct == "BasicScheduler":
add_number(nid, node, "steps", "steps", "采样步数")
continue
if ct == "CFGGuider":
add_number(nid, node, "cfg", "cfg", "CFG")
continue
if ct.startswith("Empty") and "Latent" in ct:
add_number(nid, node, "width", "width", "宽度")
add_number(nid, node, "height", "height", "高度")
add_number(nid, node, "batch_size", "batch", "批次数量")
continue
if ct in _NUMBER_PRIMITIVES and _is_scalar(inputs.get("value")):
role, label = None, title if title and title != ct else f"{ct} #{nid}"
for words, r, zh in _NUMBER_TITLE_ROLES:
if any(w in lowered for w in words):
role, label = r, (title if title and title != ct else zh)
break
if role is None and (not title or title == ct):
hint = _duration_hint(nid, workflow, consumers)
if hint == "seconds":
role, label = "duration", "时长(秒)"
elif hint == "frames":
label = "视频帧数"
if role and role in taken_roles:
role = None
if role:
taken_roles.add(role)
numbers.append(
_entry(_key(nid, node, "value"), label, role, "number", inputs["value"], False)
)
results: list[dict[str, Any]] = []
positives = [t for t in texts if not t[3]]
negatives = [t for t in texts if t[3]]
def rank(t: tuple[str, dict[str, Any], str, bool]) -> tuple[int, int]:
title = _title_of(t[1]).lower()
system = any(w in title for w in _SYSTEM_WORDS)
named = any(w in title for w in _PROMPT_WORDS)
return (1 if system else 0, 0 if named else 1)
positives.sort(key=rank)
for i, (nid, node, field, _neg) in enumerate(positives):
title = _title_of(node)
if i == 0:
results.append(
_entry(
_key(nid, node, field),
"正向提示词",
"prompt",
"textarea",
node["inputs"][field],
True,
)
)
else:
label = title if title and title != node.get("class_type") else f"文本 #{nid}"
results.append(
_entry(
_key(nid, node, field), label, None, "textarea", node["inputs"][field], False
)
)
for i, (nid, node, field, _neg) in enumerate(negatives):
role = "negative" if i == 0 else None
label = "反向提示词" if i == 0 else (_title_of(node) or f"文本 #{nid}")
results.append(
_entry(_key(nid, node, field), label, role, "textarea", node["inputs"][field], False)
)
results.extend(numbers)
results.extend(media)
return results
def _is_negative(
node_id: str, lowered_title: str, consumers: dict[str, list[tuple[str, str]]]
) -> bool:
if any(w in lowered_title for w in _NEGATIVE_WORDS):
return True
return _feeds_negative(node_id, consumers)
def parse_dynamic_outputs(workflow: dict[str, Any]) -> list[dict[str, Any]]:
results: list[dict[str, Any]] = []
for node_id, node in workflow.items():
@@ -1,4 +1,5 @@
"""Patch user values into ComfyUI API-format workflow by nodeId."""
from __future__ import annotations
import copy
@@ -6,6 +7,10 @@ from typing import Any
from calliope.comfyui.registry import class_to_patch_field
# Input keys of the form "<nodeId>@<widget>" target one named widget on a
# node (auto-detected inputs: KSampler seed/steps/cfg, latent width/height…).
FIELD_KEY_SEP = "@"
def _resolve_field(field: str, inputs: dict[str, Any]) -> str:
"""Map the computed patch field onto a key that exists on this node.
@@ -26,6 +31,13 @@ def _resolve_field(field: str, inputs: dict[str, Any]) -> str:
return field
def resolve_patch_field(node: dict[str, Any]) -> str:
"""The widget a plain nodeId key writes to on this node."""
return _resolve_field(
class_to_patch_field(node.get("class_type", "")), dict(node.get("inputs") or {})
)
def patch_workflow(
base: dict[str, Any],
values_by_node_id: dict[str, Any],
@@ -35,11 +47,18 @@ def patch_workflow(
if value is None:
continue
key = str(node_id)
field: str | None = None
if key not in patched and FIELD_KEY_SEP in key:
key, field = key.rsplit(FIELD_KEY_SEP, 1)
node = patched.get(key)
if not isinstance(node, dict):
continue
inputs = dict(node.get("inputs") or {})
field = _resolve_field(class_to_patch_field(node.get("class_type", "")), inputs)
if field is None:
field = resolve_patch_field(node)
elif isinstance(inputs.get(field), list):
# Linked input ([src_id, slot]) — never overwrite the wiring.
continue
inputs[field] = value
node["inputs"] = inputs
patched[key] = node
@@ -20,7 +20,7 @@ TEXT_AREA_CLASSES = frozenset(
NUMBER_CLASSES = frozenset(
{"INT", "FLOAT", "PrimitiveInt", "PrimitiveFloat", "KSampler", "KSamplerAdvanced"}
)
IMAGE_CLASSES = frozenset({"LoadImage", "ImageLoader", "ETN_LoadImageBase64"})
IMAGE_CLASSES = frozenset({"LoadImage", "LoadImageMask", "ImageLoader", "ETN_LoadImageBase64"})
IMAGE_URL_CLASSES = frozenset({"Load Image From Url (mtb)"})
AUDIO_CLASSES = frozenset({"LoadAudio", "VHS_LoadAudio"})
# Stock LoadVideo uses the `file` widget; VHS uses `video`.
@@ -13,6 +13,13 @@ def _find_by_role(inputs: list[dict[str, Any]], *roles: str) -> dict[str, Any] |
return None
def _node_sort_key(node_id: object) -> tuple:
"""Numeric order for "12", subgraph "171:154" and field keys "3@seed"."""
return tuple(
(0, int(p)) if p.isdigit() else (1, p) for p in str(node_id).replace("@", ":").split(":")
)
def _find_all_by_role(inputs: list[dict[str, Any]], *roles: str) -> list[dict[str, Any]]:
"""All inputs matching any of the roles, sorted by numeric node id.
@@ -21,7 +28,7 @@ def _find_all_by_role(inputs: list[dict[str, Any]], *roles: str) -> list[dict[st
in this order and it defines ``<Subject N>`` numbering in the prompt.
"""
matches = [inp for inp in inputs if input_has_role(inp, *roles)]
return sorted(matches, key=lambda i: int(i["nodeId"]))
return sorted(matches, key=lambda i: _node_sort_key(i["nodeId"]))
def ref_image_slots(inputs: list[dict[str, Any]]) -> list[dict[str, Any]]:
+19 -3
View File
@@ -22,6 +22,18 @@ from calliope.queue.manager import queue_manager
logger = logging.getLogger("calliope.worker")
def _comfy_messages(messages: list[Any]) -> str:
"""Pull the readable part out of ComfyUI's history status messages."""
parts: list[str] = []
for msg in messages:
if isinstance(msg, (list, tuple)) and len(msg) == 2 and msg[0] == "execution_error":
body = msg[1] if isinstance(msg[1], dict) else {}
node = body.get("node_type") or body.get("node_id") or "?"
reason = body.get("exception_message") or body.get("exception_type") or "未知错误"
parts.append(f"节点 {node}:{str(reason).strip()}")
return ";".join(parts) or str(messages)[:500]
class _CancelledByUser(RuntimeError):
"""The job row was flipped to 'cancelled' out-of-band (Stop button).
The row already carries the terminal state; the loop must not overwrite
@@ -167,7 +179,9 @@ class QueueWorker:
workflow_id = job.get("workflow_id") or payload.get("workflow_id")
workflow = self._load_workflow(workflow_id)
if not workflow:
raise RuntimeError("No workflow found for job")
raise RuntimeError(
"找不到该任务使用的工作流(可能已被删除),请重新选择工作流后再生成"
)
input_values = payload.get("input_values") or {}
if payload.get("continue_source") and kind == "video":
@@ -182,12 +196,14 @@ class QueueWorker:
if not history:
if queue_manager.is_cancelled(job["id"]):
raise _CancelledByUser()
raise RuntimeError("Timed out waiting for ComfyUI history")
raise RuntimeError(
"等待 ComfyUI 出结果超时:可在「设置 → 队列」调大超时,或到 ComfyUI 检查该任务"
)
status = history.get("status") or {}
if status.get("status_str") == "error" or status.get("completed") is False:
messages = status.get("messages") or []
raise RuntimeError(f"ComfyUI error: {messages}")
raise RuntimeError(f"ComfyUI 执行出错:{_comfy_messages(messages)}")
outputs_meta = client.extract_outputs(history)
dest_dir = config.settings.assets_dir / str(project_id) / kind
@@ -336,9 +336,13 @@ async def generate(payload: PlaygroundGenerate) -> dict[str, Any]:
(payload.workflow_id,),
).fetchone()
if not wf:
raise HTTPException(status_code=404, detail="Workflow not found")
raise HTTPException(
status_code=404, detail="工作流不存在(可能已被删除),请刷新页面后重新选择"
)
if not wf["is_enabled"]:
raise HTTPException(status_code=400, detail="Workflow is disabled")
raise HTTPException(
status_code=400, detail="该工作流已停用,请到「ComfyUI 连接」页启用后再生成"
)
kind = wf["kind"]
finally:
conn.close()
@@ -18,6 +18,9 @@ def _serialize_workflow(row: Any) -> dict[str, Any]:
data = row_to_dict(row)
data["workflow_json"] = json.loads(data["workflow_json"])
data["input_schema"] = json.loads(data["input_schema"]) if data.get("input_schema") else []
if not data["input_schema"]:
# An empty stored schema is re-derived so untagged workflows still expose inputs.
data["input_schema"] = parse_dynamic_inputs(data["workflow_json"])
data["output_schema"] = json.loads(data["output_schema"]) if data.get("output_schema") else []
data["is_enabled"] = bool(data.get("is_enabled"))
return data
@@ -0,0 +1,808 @@
{
"115": {
"inputs": {
"aspect_ratio": "9:16 (Portrait Widescreen)",
"megapixels": 0.6,
"multiple": 32
},
"class_type": "ResolutionSelector",
"_meta": {
"title": "Resolution Selector"
}
},
"207": {
"inputs": {
"vae_name": "minimax-h3\\minimax_h3_video_vae_fp16.safetensors"
},
"class_type": "VAELoader",
"_meta": {
"title": "Load VAE"
}
},
"208": {
"inputs": {
"vae_name": "minimax-h3\\minimax_h3_audio_vae_fp32.safetensors"
},
"class_type": "VAELoader",
"_meta": {
"title": "Load VAE"
}
},
"209": {
"inputs": {
"samples": [
"213",
0
],
"vae": [
"208",
0
]
},
"class_type": "VAEDecodeAudio",
"_meta": {
"title": "VAE Decode Audio"
}
},
"210": {
"inputs": {
"samples": [
"213",
0
],
"vae": [
"207",
0
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE Decode"
}
},
"211": {
"inputs": {
"sampler_name": "euler"
},
"class_type": "KSamplerSelect",
"_meta": {
"title": "KSamplerSelect"
}
},
"212": {
"inputs": {
"scheduler": "beta",
"steps": 6,
"denoise": 1,
"model": [
"6007",
0
]
},
"class_type": "BasicScheduler",
"_meta": {
"title": "BasicScheduler"
}
},
"213": {
"inputs": {
"noise": [
"217",
0
],
"guider": [
"214",
0
],
"sampler": [
"211",
0
],
"sigmas": [
"212",
0
],
"latent_image": [
"219",
1
]
},
"class_type": "SamplerCustomAdvanced",
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"214": {
"inputs": {
"model": [
"6007",
0
],
"conditioning": [
"219",
0
]
},
"class_type": "BasicGuider",
"_meta": {
"title": "Basic Guider"
}
},
"215": {
"inputs": {
"unet_name": "minimax-h3\\minimax_h3_fl2va_int8_convrot.safetensors",
"weight_dtype": "default"
},
"class_type": "UNETLoader",
"_meta": {
"title": "Load Diffusion Model"
}
},
"216": {
"inputs": {
"clip_name": "minimax-h3\\qwen3vl_32b_minimax_h3_int8_convrot.comfy.safetensors",
"type": "minimax",
"device": "default"
},
"class_type": "CLIPLoader",
"_meta": {
"title": "Load CLIP"
}
},
"217": {
"inputs": {
"noise_seed": 42
},
"class_type": "RandomNoise",
"_meta": {
"title": "RandomNoise"
}
},
"219": {
"inputs": {
"prompt": [
"6005",
0
],
"width": [
"115",
0
],
"height": [
"115",
1
],
"length": [
"220",
1
],
"clip": [
"6010",
1
],
"vae": [
"207",
0
]
},
"class_type": "MiniMaxH3ImageToVideo",
"_meta": {
"title": "MiniMax H3 Image to Video"
}
},
"220": {
"inputs": {
"expression": "max(5, round(a * 24)) + (5 - (max(5, round(a * 24)) % 17)) % 17",
"values.a": [
"221",
0
]
},
"class_type": "ComfyMathExpression",
"_meta": {
"title": "Math Expression"
}
},
"221": {
"inputs": {
"value": 10
},
"class_type": "PrimitiveFloat",
"_meta": {
"title": "Seconds"
}
},
"223": {
"inputs": {
"sage_attention": "auto",
"allow_compile": false,
"model": [
"6020",
0
]
},
"class_type": "PathchSageAttentionKJ",
"_meta": {
"title": "Patch Sage Attention KJ"
}
},
"5970": {
"inputs": {
"model_name": "film_net_fp16.safetensors"
},
"class_type": "FrameInterpolationModelLoader",
"_meta": {
"title": "Load Frame Interpolation Model"
}
},
"5971": {
"inputs": {
"multiplier": 2,
"interp_model": [
"5970",
0
],
"images": [
"5976",
0
]
},
"class_type": "FrameInterpolate",
"_meta": {
"title": "Run Frame Interpolation Model"
}
},
"5974": {
"inputs": {
"expression": "a*2",
"a": [
"5986",
0
]
},
"class_type": "MathExpression|pysssss",
"_meta": {
"title": "Math Expression 🐍"
}
},
"5975": {
"inputs": {
"resize_type": "scale by multiplier",
"resize_type.scale": 1.5,
"quality": "ULTRA",
"images": [
"5971",
0
]
},
"class_type": "RTXVideoSuperResolution",
"_meta": {
"title": "RTX Video Super Resolution Pro"
}
},
"5976": {
"inputs": {
"anything": [
"5977",
0
]
},
"class_type": "easy clearCacheAll",
"_meta": {
"title": "Clear Cache All"
}
},
"5977": {
"inputs": {
"anything": [
"6063:5538",
0
]
},
"class_type": "easy cleanGpuUsed",
"_meta": {
"title": "Clean VRAM Used"
}
},
"5978": {
"inputs": {
"frame_rate": [
"5974",
1
],
"loop_count": 0,
"filename_prefix": "minimax-h3/vid-vfi",
"format": "video/h264-mp4",
"pix_fmt": "yuv420p",
"crf": 19,
"save_metadata": true,
"trim_to_audio": false,
"pingpong": false,
"save_output": true,
"images": [
"5975",
0
],
"audio": [
"6063:4848",
0
]
},
"class_type": "VHS_VideoCombine",
"_meta": {
"title": "Video Output 2"
}
},
"5986": {
"inputs": {
"value": 24
},
"class_type": "PrimitiveFloat",
"_meta": {
"title": "PrimitiveFloat"
}
},
"6005": {
"inputs": {
"value": "integrated_multimodal_description: [Shot 1] Cinematic, live-action, shot on iPhone, a vertical selfie frame from a phone held at arm's length above eye level. A young woman in her mid-twenties with sun-kissed tan skin and loose wavy chestnut brown hair, wearing a white cropped t-shirt with a gold pendant necklace, looks directly into the phone lens, her face filling the centre of frame. Warm golden hour sunlight hits the right side of her face from a low sun behind the trees, casting a soft amber glow across her skin. Behind her, a city park is blurred into soft green and gold bokeh — trees, dappled light, a hot pink sunset sky bleeding through the leaves. The camera holds static in selfie framing. The young woman's lips move as she speaks with a bright, energetic voice with a slight North American accent (S1): <d>[English] Oh my god, you guys, it is actually perfect out here right now.</d> Her mouth closes after the last word, then she breaks into a wide grin, teeth showing, the skin at the corners of her eyes crinkling. She tilts her head slightly to the right, the grin fading to a soft expression as her lips move and she speaks again, her voice warmer (S1): <d>[English] Like, I didn't want to leave.</d> Her mouth closes. She presses her lips together, then points her index finger at the camera and speaks with a playful tone, her lips forming each word (S1): <d>[English] So I'm not.</d> Her mouth closes, and the wide grin returns. With her free left hand she pushes the windblown hair behind her ear, her gold bracelet sliding down her wrist. She raises her free hand in a quick peace sign next to her cheek, her smile widening, and laughs — a short, genuine laugh, her mouth opening, shoulders shaking once, her eyes squeezing shut for a beat, then opening again. She drops the peace sign and brings the phone slightly closer, her face growing larger in frame, the grin settling into a warm smile. The camera pushes in with small amplitude at slow speed as the phone draws closer.\n\noverall_soundscape: A warm breeze carries birdsong and the distant hum of a city at golden hour. The woman's laugh is clear and close to the phone mic — short, genuine, with a slight exhale. Loose hair rustles as she tucks it behind her ear, and the gold bracelet lightly clinks against itself on her wrist.\n\nnon_diegetic_music: N/A"
},
"class_type": "PrimitiveStringMultiline",
"_meta": {
"title": "Text Prompt"
}
},
"6006": {
"inputs": {
"lora_name": "minimax-h3\\minimax_h3_fl2v_turbo_4step_v1.1_768p_comfyui_bf16.safetensors",
"strength_model": 0.6,
"model": [
"215",
0
]
},
"class_type": "LoraLoaderModelOnly",
"_meta": {
"title": "Load LoRA"
}
},
"6007": {
"inputs": {
"shift_video": 12,
"shift_audio": 3,
"model": [
"223",
0
]
},
"class_type": "MiniMaxH3SigmaShift",
"_meta": {
"title": "ModelSamplingMiniMaxH3"
}
},
"6010": {
"inputs": {
"PowerLoraLoaderHeaderWidget": {
"type": "PowerLoraLoaderHeaderWidget"
},
"lora_1": {
"on": true,
"lora": "minimax-h3\\h3-realism-people-t2v-i2v-r2v(r34l1sm).safetensors",
"strength": 1
},
"➕ Add Lora": "",
"model": [
"6006",
0
],
"clip": [
"216",
0
]
},
"class_type": "Power Lora Loader (rgthree)",
"_meta": {
"title": "Power Lora Loader (rgthree)"
}
},
"6020": {
"inputs": {
"tau": 1.2,
"start_percent": 0.2,
"end_percent": 0.9,
"min_tokens": 4096,
"int8_qk": false,
"sink_conditioning": "exact_kv",
"morton": false,
"morton_curve": "3d",
"verbose": false,
"model": [
"6010",
0
]
},
"class_type": "SolAttnPatch",
"_meta": {
"title": "Patch Sol-Attn"
}
},
"6059": {
"inputs": {
"anything": [
"6060",
0
]
},
"class_type": "easy clearCacheAll",
"_meta": {
"title": "Clear Cache All"
}
},
"6060": {
"inputs": {
"anything": [
"210",
0
]
},
"class_type": "easy cleanGpuUsed",
"_meta": {
"title": "Clean VRAM Used"
}
},
"6062:5570": {
"inputs": {
"vae_name": "ltx-2.5\\ltx-2.5-audio-vae-bf16.safetensors"
},
"class_type": "VAELoader",
"_meta": {
"title": "Load VAE - Audio"
}
},
"6062:5571": {
"inputs": {
"vae_name": "ltx-2.5\\ltx-2.5-video-vae-bf16.safetensors"
},
"class_type": "VAELoader",
"_meta": {
"title": "Load VAE - Video"
}
},
"6062:5569": {
"inputs": {
"unet_name": "ltx-2.5\\ltx-2.5-22b-distilled-transformer-comfy-int8-convrot.safetensors",
"weight_dtype": "default"
},
"class_type": "UNETLoader",
"_meta": {
"title": "Load Diffusion Model"
}
},
"6062:5577": {
"inputs": {
"model_name": "ltx-2.5\\ltx-2.5-latent-spatial-upscaler-x2-bf16-1.0.safetensors"
},
"class_type": "LatentUpscaleModelLoader",
"_meta": {
"title": "Load Latent Upscale Model"
}
},
"6062:5574": {
"inputs": {
"clip_name": "gemma4-12b-with-proj-ltx-2.5-comfy-int8-convrot.safetensors",
"type": "ltxv",
"device": "default"
},
"class_type": "CLIPLoader",
"_meta": {
"title": "Load CLIP - Text Encoder"
}
},
"6065:2612": {
"inputs": {
"text": "",
"clip": [
"6062:5574",
0
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Negative Prompt)"
}
},
"6065:2483": {
"inputs": {
"text": [
"6005",
0
],
"clip": [
"6062:5574",
0
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"6065:1241": {
"inputs": {
"frame_rate": [
"5986",
0
],
"positive": [
"6065:2483",
0
],
"negative": [
"6065:2612",
0
]
},
"class_type": "LTXVConditioning",
"_meta": {
"title": "LTXVConditioning"
}
},
"6061:4985": {
"inputs": {
"sigmas": "0.85, 0.7250, 0.4219, 0.0"
},
"class_type": "ManualSigmas",
"_meta": {
"title": "ManualSigmas"
}
},
"6061:4976": {
"inputs": {
"sampler_name": "euler"
},
"class_type": "KSamplerSelect",
"_meta": {
"title": "KSamplerSelect"
}
},
"6061:4964": {
"inputs": {
"cfg": 1,
"model": [
"6062:5569",
0
],
"positive": [
"6065:1241",
0
],
"negative": [
"6065:1241",
1
]
},
"class_type": "CFGGuider",
"_meta": {
"title": "CFG Guider"
}
},
"6061:4967": {
"inputs": {
"noise_seed": 42
},
"class_type": "RandomNoise",
"_meta": {
"title": "RandomNoise"
}
},
"6061:4973": {
"inputs": {
"av_latent": [
"6061:4971",
0
]
},
"class_type": "LTXVSeparateAVLatent",
"_meta": {
"title": "LTXVSeparateAVLatent"
}
},
"6061:4971": {
"inputs": {
"noise": [
"6061:4967",
0
],
"guider": [
"6061:4964",
0
],
"sampler": [
"6061:4976",
0
],
"sigmas": [
"6061:4985",
0
],
"latent_image": [
"6061:4969",
0
]
},
"class_type": "SamplerCustomAdvanced",
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"6061:4969": {
"inputs": {
"video_latent": [
"6061:4970",
0
],
"audio_latent": [
"6061:6074",
0
]
},
"class_type": "LTXVConcatAVLatent",
"_meta": {
"title": "LTXVConcatAVLatent"
}
},
"6061:6072": {
"inputs": {
"value": 0,
"width": [
"6061:6073",
0
],
"height": [
"6061:6073",
1
]
},
"class_type": "SolidMask",
"_meta": {
"title": "Create Solid Mask"
}
},
"6061:4975": {
"inputs": {
"samples": [
"6061:6070",
0
],
"upscale_model": [
"6062:5577",
0
],
"vae": [
"6062:5571",
0
]
},
"class_type": "LTXVLatentUpsampler",
"_meta": {
"title": "LTXVLatentUpsampler"
}
},
"6061:6070": {
"inputs": {
"pixels": [
"6059",
0
],
"vae": [
"6062:5571",
0
]
},
"class_type": "VAEEncode",
"_meta": {
"title": "VAE Encode"
}
},
"6061:4970": {
"inputs": {
"strength": 1,
"bypass": true,
"vae": [
"6062:5571",
0
],
"image": [
"6059",
0
],
"latent": [
"6061:4975",
0
]
},
"class_type": "LTXVImgToVideoInplace",
"_meta": {
"title": "LTXVImgToVideoInplace"
}
},
"6061:6074": {
"inputs": {
"samples": [
"6061:6075",
0
],
"mask": [
"6061:6072",
0
]
},
"class_type": "SetLatentNoiseMask",
"_meta": {
"title": "Set Latent Noise Mask"
}
},
"6061:6073": {
"inputs": {
"image": [
"6059",
0
]
},
"class_type": "GetImageSize",
"_meta": {
"title": "Get Image Size"
}
},
"6061:6075": {
"inputs": {
"audio": [
"209",
0
],
"audio_vae": [
"6062:5570",
0
]
},
"class_type": "LTXVAudioVAEEncode",
"_meta": {
"title": "LTXV Audio VAE Encode"
}
},
"6063:5538": {
"inputs": {
"tile_size": 512,
"overlap": 64,
"temporal_size": 128,
"temporal_overlap": 32,
"samples": [
"6061:4973",
0
],
"vae": [
"6062:5571",
0
]
},
"class_type": "VAEDecodeTiled",
"_meta": {
"title": "VAE Decode (Tiled)"
}
},
"6063:4848": {
"inputs": {
"samples": [
"6061:4973",
1
],
"audio_vae": [
"6062:5570",
0
]
},
"class_type": "LTXVAudioVAEDecode",
"_meta": {
"title": "LTXV Audio VAE Decode"
}
}
}
@@ -0,0 +1,126 @@
{
"3": {
"inputs": {
"seed": 761215360232465,
"steps": 20,
"cfg": 2.5,
"sampler_name": "euler",
"scheduler": "simple",
"denoise": 1,
"model": ["75", 0],
"positive": ["76", 0],
"negative": ["77", 0],
"latent_image": ["90", 0]
},
"class_type": "KSampler",
"_meta": { "title": "KSampler" }
},
"8": {
"inputs": {
"samples": ["3", 0],
"vae": ["39", 0]
},
"class_type": "VAEDecode",
"_meta": { "title": "VAE Decode" }
},
"37": {
"inputs": {
"unet_name": "qwen_image_edit_2509_fp8_e4m3fn.safetensors",
"weight_dtype": "default"
},
"class_type": "UNETLoader",
"_meta": { "title": "Load Diffusion Model" }
},
"38": {
"inputs": {
"clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
"type": "qwen_image",
"device": "default"
},
"class_type": "CLIPLoader",
"_meta": { "title": "Load CLIP" }
},
"39": {
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
},
"class_type": "VAELoader",
"_meta": { "title": "Load VAE" }
},
"60": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": ["8", 0]
},
"class_type": "SaveImage",
"_meta": { "title": "Save Image" }
},
"75": {
"inputs": {
"shift": 3,
"model": ["37", 0]
},
"class_type": "ModelSamplingAuraFlow",
"_meta": { "title": "ModelSamplingAuraFlow" }
},
"76": {
"inputs": {
"prompt": "把背景换成夜晚的城市街道",
"clip": ["38", 0],
"vae": ["39", 0],
"image1": ["93", 0]
},
"class_type": "TextEncodeQwenImageEditPlus",
"_meta": { "title": "TextEncodeQwenImageEditPlus" }
},
"77": {
"inputs": {
"prompt": "",
"clip": ["38", 0],
"vae": ["39", 0],
"image1": ["93", 0]
},
"class_type": "TextEncodeQwenImageEditPlus",
"_meta": { "title": "TextEncodeQwenImageEditPlus" }
},
"78": {
"inputs": {
"image": "example.png"
},
"class_type": "LoadImage",
"_meta": { "title": "Load Image" }
},
"88": {
"inputs": {
"pixels": ["93", 0],
"vae": ["39", 0]
},
"class_type": "VAEEncode",
"_meta": { "title": "VAE Encode" }
},
"90": {
"inputs": {
"samples": ["88", 0],
"mask": ["95", 0]
},
"class_type": "SetLatentNoiseMask",
"_meta": { "title": "Set Latent Noise Mask" }
},
"93": {
"inputs": {
"upscale_method": "lanczos",
"megapixels": 1,
"image": ["78", 0]
},
"class_type": "ImageScaleToTotalPixels",
"_meta": { "title": "Scale Image to Total Pixels" }
},
"95": {
"inputs": {
"image": "mask.png",
"channel": "alpha"
},
"class_type": "LoadImageMask",
"_meta": { "title": "Load Image (as Mask)" }
}
}
@@ -0,0 +1,91 @@
{
"3": {
"inputs": {
"seed": 1125488487853216,
"steps": 20,
"cfg": 2.5,
"sampler_name": "euler",
"scheduler": "simple",
"denoise": 1,
"model": ["66", 0],
"positive": ["6", 0],
"negative": ["7", 0],
"latent_image": ["58", 0]
},
"class_type": "KSampler",
"_meta": { "title": "KSampler" }
},
"6": {
"inputs": {
"text": "一只橘猫坐在窗台上,午后阳光,电影感",
"clip": ["38", 0]
},
"class_type": "CLIPTextEncode",
"_meta": { "title": "CLIP Text Encode (Positive Prompt)" }
},
"7": {
"inputs": {
"text": "",
"clip": ["38", 0]
},
"class_type": "CLIPTextEncode",
"_meta": { "title": "CLIP Text Encode (Negative Prompt)" }
},
"8": {
"inputs": {
"samples": ["3", 0],
"vae": ["39", 0]
},
"class_type": "VAEDecode",
"_meta": { "title": "VAE Decode" }
},
"37": {
"inputs": {
"unet_name": "qwen_image_fp8_e4m3fn.safetensors",
"weight_dtype": "default"
},
"class_type": "UNETLoader",
"_meta": { "title": "Load Diffusion Model" }
},
"38": {
"inputs": {
"clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
"type": "qwen_image",
"device": "default"
},
"class_type": "CLIPLoader",
"_meta": { "title": "Load CLIP" }
},
"39": {
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
},
"class_type": "VAELoader",
"_meta": { "title": "Load VAE" }
},
"58": {
"inputs": {
"width": 1328,
"height": 1328,
"batch_size": 1
},
"class_type": "EmptySD3LatentImage",
"_meta": { "title": "EmptySD3LatentImage" }
},
"60": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": ["8", 0]
},
"class_type": "SaveImage",
"_meta": { "title": "Save Image" }
},
"66": {
"inputs": {
"shift": 3.1,
"model": ["37", 0]
},
"class_type": "ModelSamplingAuraFlow",
"_meta": { "title": "ModelSamplingAuraFlow" }
}
}
@@ -0,0 +1,301 @@
{
"1": {
"inputs": {
"value": "PASTE YOUR PROMPT HERE. Use the MiniMax-H3 prompt contract (integrated_multimodal_description / overall_soundscape / non_diegetic_music). The previews in this repo were made with a ten-shot subway prompt posted by a community member; it is not redistributed here."
},
"class_type": "PrimitiveStringMultiline",
"_meta": {
"title": "PROMPT (feeds every stage)"
}
},
"92": {
"inputs": {
"filename_prefix": "video/01_reference_4step_sla",
"format": "auto",
"format.codec": "auto",
"codec": "auto",
"video": [
"130",
0
]
},
"class_type": "SaveVideo",
"_meta": {
"title": "REFERENCE 2026-08-29: fused ref-delta bake + SLA 0.9/64, res_multistep/simple/4, shift 12/3, 1152x640, 243 f, seed 42 -> subway_bake_sla_00001_.mp4"
}
},
"115": {
"inputs": {
"aspect_ratio": "16:9 (Widescreen)",
"megapixels": 0.7,
"multiple": 32
},
"class_type": "ResolutionSelector",
"_meta": {
"title": "ResolutionSelector"
}
},
"116": {
"inputs": {
"expression": "a"
},
"class_type": "ComfyMathExpression",
"_meta": {
"title": "ComfyMathExpression"
}
},
"119": {
"inputs": {
"vae_name": "minimax_h3_video_vae_int8_convrot.safetensors"
},
"class_type": "VAELoader",
"_meta": {
"title": "VAELoader"
}
},
"120": {
"inputs": {
"vae_name": "minimax_h3_audio_vae_fp32.safetensors"
},
"class_type": "VAELoader",
"_meta": {
"title": "VAELoader"
}
},
"121": {
"inputs": {
"samples": [
"125",
0
],
"vae": [
"120",
0
]
},
"class_type": "VAEDecodeAudio",
"_meta": {
"title": "VAEDecodeAudio"
}
},
"122": {
"inputs": {
"samples": [
"125",
0
],
"vae": [
"119",
0
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAEDecode"
}
},
"124": {
"inputs": {
"scheduler": "simple",
"steps": 4,
"denoise": 1,
"model": [
"142",
0
]
},
"class_type": "BasicScheduler",
"_meta": {
"title": "BasicScheduler"
}
},
"125": {
"inputs": {
"noise": [
"129",
0
],
"guider": [
"126",
0
],
"sampler": [
"135",
0
],
"sigmas": [
"124",
0
],
"latent_image": [
"131",
1
]
},
"class_type": "SamplerCustomAdvanced",
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"126": {
"inputs": {
"model": [
"142",
0
],
"conditioning": [
"131",
0
]
},
"class_type": "BasicGuider",
"_meta": {
"title": "BasicGuider"
}
},
"127": {
"inputs": {
"unet_name": "minimax_h3_fused_refdelta_r1024_turbo8_mystic07_int8_convrot.safetensors",
"weight_dtype": "default"
},
"class_type": "UNETLoader",
"_meta": {
"title": "UNETLoader"
}
},
"128": {
"inputs": {
"clip_name": "qwen3vl_32b_heretic_minimax_h3_nvfp4.safetensors",
"type": "minimax",
"device": "default"
},
"class_type": "CLIPLoader",
"_meta": {
"title": "CLIPLoader"
}
},
"129": {
"inputs": {
"noise_seed": 42
},
"class_type": "RandomNoise",
"_meta": {
"title": "RandomNoise"
}
},
"130": {
"inputs": {
"fps": 24,
"bit_depth": 8,
"color_space": "sRGB",
"codec": "none",
"images": [
"122",
0
],
"audio": [
"121",
0
]
},
"class_type": "CreateVideo",
"_meta": {
"title": "CreateVideo"
}
},
"131": {
"inputs": {
"prompt": [
"1",
0
],
"width": [
"115",
0
],
"height": [
"115",
1
],
"length": [
"132",
1
],
"clip": [
"128",
0
],
"vae": [
"119",
0
]
},
"class_type": "MiniMaxH3ImageToVideo",
"_meta": {
"title": "MiniMaxH3ImageToVideo"
}
},
"132": {
"inputs": {
"expression": "max(5, round(a * 24)) + (5 - (max(5, round(a * 24)) % 17)) % 17",
"values.a": [
"133",
0
]
},
"class_type": "ComfyMathExpression",
"_meta": {
"title": "ComfyMathExpression"
}
},
"133": {
"inputs": {
"value": 10
},
"class_type": "PrimitiveFloat",
"_meta": {
"title": "PrimitiveFloat"
}
},
"135": {
"inputs": {
"sampler_name": "res_multistep"
},
"class_type": "KSamplerSelect",
"_meta": {
"title": "KSamplerSelect"
}
},
"142": {
"inputs": {
"shift_video": 12,
"shift_audio": 3,
"model": [
"900",
0
]
},
"class_type": "MiniMaxH3SigmaShift",
"_meta": {
"title": "MiniMaxH3SigmaShift"
}
},
"900": {
"inputs": {
"sparsity_ratio": 0.9,
"block_size": "64",
"min_seq_len": 8192,
"dense_last_steps": 0,
"protect_audio": true,
"enabled": true,
"model": [
"127",
0
]
},
"class_type": "H3SLAAttention",
"_meta": {
"title": "H3 SLA Attention 0.9/64 (their graph)"
}
}
}
@@ -0,0 +1,137 @@
{
"13": {
"inputs": {
"aspect_ratio": "1:1 (Square)",
"megapixels": 1,
"multiple": 8
},
"class_type": "ResolutionSelector",
"_meta": {
"title": "分辨率选择器"
}
},
"461": {
"inputs": {
"filename_prefix": "Qwen_image_2.1",
"format": "png",
"format.bit_depth": "8-bit",
"format.input_color_space": "sRGB",
"images": [
"459:457",
0
]
},
"class_type": "SaveImageAdvanced",
"_meta": {
"title": "保存图像(高级)"
}
},
"459:451": {
"inputs": {
"unet_name": "qwen_image_2.1_int8_convrot.safetensors",
"weight_dtype": "default"
},
"class_type": "UNETLoader",
"_meta": {
"title": "UNet加载器"
}
},
"459:452": {
"inputs": {
"prompt": "Greyscale fashion editorial portrait of an avant-garde woman tilted upwards in profile, captured with striking high-contrast chiaroscuro lighting. She wears oversized, thick-rimmed circular black sunglasses with matte dark lenses, concealing her upward gaze. Her attire merges high couture with tactical abstraction: a high-necked structural dress tailored from heavyweight fabric featuring a disrupted optical camouflage pattern—interlocking oversized polka dots, pixelated stippling, and organic contour blotches in stark monochrome that mimic military disruptive patterns in a refined runway style. Around her shoulders, asymmetric pleated webbing and tailored cargo straps are integrated seamlessly into the garment’s architecture. In her gloved hand, she clutches a structured matte-leather geometric handbag accented with subtle tactical buckles, utility stitching, and dark brushed-metal hardware. Her skin texture is rendered with hyper-detailed clarity, sculpted by intense, razor-sharp studio key light and deep graphite shadows. The striking background is a vivid mixed-media graphic collage, composed of flat vibrant lime green planes, stark black and white overlapping circles, segmented semi-circles with bold zebra striping, dense micro-halftone dot matrices, and vector topographic contour lines. The clash between monochromatic disruptive camo elements on her clothing and the saturated, retro-futuristic pop-art backdrop creates an intense visual dissonance, emphasizing sharp silhouettes, paper cut-out edges, dynamic compositional balance, and clean graphic novel textures. Absolutely no text, no typography, no letters, no words, no numbers, no logos, no watermark, no captions, pure imagery only.",
"negative_prompt": "",
"resolution": 1024,
"clip": [
"459:453",
0
]
},
"class_type": "TextEncodeQwenImage21",
"_meta": {
"title": "Text Encode Qwen Image 2.1"
}
},
"459:453": {
"inputs": {
"clip_name": "qwen3vl_8b_int8_convrot.safetensors",
"type": "qwen_image",
"device": "default"
},
"class_type": "CLIPLoader",
"_meta": {
"title": "加载CLIP"
}
},
"459:454": {
"inputs": {
"vae_name": "qwen_image_2.1_vae_bf16.safetensors"
},
"class_type": "VAELoader",
"_meta": {
"title": "加载VAE"
}
},
"459:456": {
"inputs": {
"width": [
"13",
0
],
"height": [
"13",
1
],
"batch_size": 1
},
"class_type": "EmptyLatentImage",
"_meta": {
"title": "空Latent图像"
}
},
"459:457": {
"inputs": {
"samples": [
"459:458",
0
],
"vae": [
"459:454",
0
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE解码"
}
},
"459:458": {
"inputs": {
"seed": 593103825222985,
"steps": 25,
"cfg": 1,
"sampler_name": "euler",
"scheduler": "simple",
"denoise": 1,
"model": [
"459:451",
0
],
"positive": [
"459:452",
0
],
"negative": [
"459:452",
1
],
"latent_image": [
"459:456",
0
]
},
"class_type": "KSampler",
"_meta": {
"title": "K采样器"
}
}
}
+2 -1
View File
@@ -114,7 +114,8 @@ def test_queue_prompt_surfaces_comfy_error_body(monkeypatch):
msg = asyncio.run(run())
assert "prompt_outputs_failed_validation" in msg
assert "node 12" in msg
assert "节点 12" in msg
assert "HTTP 400" in msg
assert "Invalid audio file" in msg
@@ -0,0 +1,288 @@
"""HEL-623: workflows exported straight from ComfyUI (no (Input:…) title tags)
still expose a prompt and their fillable widgets, patch back onto the right
widget, and run the full 导入→填参→生成→历史 chain against a fake ComfyUI."""
from __future__ import annotations
import json
from pathlib import Path
from calliope.comfyui.parser import parse_dynamic_inputs
from calliope.comfyui.patcher import patch_workflow
from calliope.comfyui.smart_fill import ref_image_slots
from calliope.config import settings
from calliope.db import get_db
from tests.test_studio_generation import ( # noqa: F401 — fixture re-export
_import_workflow,
_real_run,
_wait_done,
fake_comfy,
)
FIXTURES = Path(__file__).parent / "fixtures" / "comfy_native"
EXAMPLES = Path(__file__).resolve().parents[2] / "example_ComfyUI_workflows"
def _load(name: str) -> dict:
return json.loads((FIXTURES / name).read_text(encoding="utf-8"))
def _by_role(inputs: list[dict]) -> dict[str, dict]:
return {i["role"]: i for i in inputs if i.get("role")}
def test_native_qwen_t2i_exposes_prompt_and_sampler_widgets():
inputs = parse_dynamic_inputs(_load("qwen_image_t2i_API.json"))
roles = _by_role(inputs)
assert roles["prompt"]["nodeId"] == "6"
assert roles["prompt"]["required"] is True
assert roles["prompt"]["defaultValue"].startswith("一只橘猫")
assert roles["negative"]["nodeId"] == "7"
assert roles["seed"]["nodeId"] == "3@seed"
assert roles["steps"]["nodeId"] == "3@steps"
assert roles["cfg"]["nodeId"] == "3@cfg"
assert roles["width"]["nodeId"] == "58@width"
assert roles["height"]["nodeId"] == "58@height"
assert roles["batch"]["nodeId"] == "58@batch_size"
assert all(i["auto"] for i in inputs)
assert [i for i in inputs if i["required"]] == [roles["prompt"]]
def test_native_qwen_edit_detects_image_and_mask_slots():
inputs = parse_dynamic_inputs(_load("qwen_image_edit_mask_API.json"))
roles = _by_role(inputs)
# TextEncodeQwenImageEditPlus writes `prompt`, not the class-derived field
assert roles["prompt"]["nodeId"] == "76@prompt"
assert roles["negative"]["nodeId"] == "77@prompt"
media = {i["nodeId"]: i for i in inputs if i["kind"] == "image"}
assert set(media) == {"78", "95"}
assert media["95"]["role"] == "mask"
assert "mask" in media["95"]["label"].lower() or "遮罩" in media["95"]["label"]
# the workflow's own image names stay valid, so the slots are optional
assert not media["78"]["required"] and not media["95"]["required"]
def test_untagged_h3_video_detects_prompt_duration_seed():
inputs = parse_dynamic_inputs(_load("minimax_h3_t2v_untagged_API.json"))
roles = _by_role(inputs)
assert roles["prompt"]["nodeId"] == "6005"
assert roles["duration"]["nodeId"] == "221"
assert roles["seed"]["nodeId"] == "217@noise_seed"
def test_real_qwen21_t2i_splits_single_encoder_into_both_prompts():
"""白栖知的 wen-sheng-tu.json:一个 TextEncodeQwenImage21 同时喂 positive/negative."""
wf = _load("wen_sheng_tu_API.json")
inputs = parse_dynamic_inputs(wf)
roles = _by_role(inputs)
assert roles["prompt"]["nodeId"] == "459:452@prompt"
assert roles["prompt"]["label"] == "正向提示词"
assert roles["prompt"]["required"] is True
assert roles["prompt"]["defaultValue"].startswith("Greyscale fashion editorial")
assert roles["negative"]["nodeId"] == "459:452@negative_prompt"
assert roles["negative"]["label"] == "反向提示词"
assert roles["negative"]["required"] is False
assert roles["seed"]["nodeId"] == "459:458@seed"
assert roles["steps"]["nodeId"] == "459:458@steps"
assert roles["cfg"]["nodeId"] == "459:458@cfg"
assert roles["batch"]["nodeId"] == "459:456@batch_size"
# width/height are wired from the resolution selector — not exposed
assert "width" not in roles and "height" not in roles
assert [i for i in inputs if i["required"]] == [roles["prompt"]]
patched = patch_workflow(
wf, {roles["prompt"]["nodeId"]: "新正向", roles["negative"]["nodeId"]: "模糊"}
)
enc = patched["459:452"]["inputs"]
assert enc["prompt"] == "新正向"
assert enc["negative_prompt"] == "模糊"
assert enc["clip"] == ["459:453", 0]
def test_real_h3_t2v_duration_from_expression_primitive():
"""wen-sheng-shipin.json:无标题 PrimitiveFloat 经表达式换算帧数 → 时长(秒)."""
inputs = parse_dynamic_inputs(_load("wen_sheng_shipin_API.json"))
roles = _by_role(inputs)
assert roles["prompt"]["nodeId"] == "1"
assert roles["prompt"]["required"] is True
assert roles["duration"]["nodeId"] == "133"
assert roles["duration"]["label"] == "时长(秒)"
assert roles["duration"]["defaultValue"] == 10
assert roles["seed"]["nodeId"] == "129@noise_seed"
assert roles["steps"]["nodeId"] == "124@steps"
assert "negative" not in roles
def _encoder_graph(encoder: dict, positive_slot: list, negative_slot: list) -> dict:
return {
"1": encoder,
"2": {
"class_type": "KSampler",
"inputs": {"seed": 1, "steps": 20, "cfg": 4, "positive": positive_slot,
"negative": negative_slot},
},
}
def test_custom_encoder_with_text_and_negative_prompt_is_split():
wf = _encoder_graph(
{"class_type": "MyTextEncodeDual", "inputs": {"text": "猫", "negative_prompt": "糊"},
"_meta": {"title": "MyTextEncodeDual"}},
["1", 0],
["1", 1],
)
roles = _by_role(parse_dynamic_inputs(wf))
assert roles["prompt"]["nodeId"] == "1"
assert roles["prompt"]["defaultValue"] == "猫"
assert roles["negative"]["nodeId"] == "1@negative_prompt"
def test_clip_encoder_wired_to_both_positive_and_negative_stays_positive():
wf = _encoder_graph(
{"class_type": "CLIPTextEncode", "inputs": {"text": "猫"},
"_meta": {"title": "CLIP Text Encode"}},
["1", 0],
["1", 0],
)
roles = _by_role(parse_dynamic_inputs(wf))
assert roles["prompt"]["nodeId"] == "1"
assert "negative" not in roles
def test_tagged_workflows_are_unchanged():
for path in sorted(EXAMPLES.glob("*.json")):
inputs = parse_dynamic_inputs(json.loads(path.read_text(encoding="utf-8")))
assert inputs, path.name
assert not any(i.get("auto") for i in inputs), path.name
assert all("@" not in i["nodeId"] for i in inputs), path.name
def test_patch_field_keys_write_named_widget_and_keep_links():
wf = _load("qwen_image_t2i_API.json")
patched = patch_workflow(
wf,
{"6": "新的提示词", "3@seed": 7, "3@steps": 12, "58@width": 1024, "3@model": "x"},
)
assert patched["6"]["inputs"]["text"] == "新的提示词"
assert patched["3"]["inputs"]["seed"] == 7
assert patched["3"]["inputs"]["steps"] == 12
assert patched["58"]["inputs"]["width"] == 1024
# linked input stays wired; the base workflow is untouched
assert patched["3"]["inputs"]["model"] == ["66", 0]
assert wf["3"]["inputs"]["seed"] == 1125488487853216
def test_smart_fill_sort_accepts_subgraph_and_field_ids():
slots = ref_image_slots(
[
{"nodeId": "171:12", "role": "image", "kind": "image"},
{"nodeId": "9", "role": "image", "kind": "image"},
{"nodeId": "3@image", "role": "image", "kind": "image"},
]
)
assert [s["nodeId"] for s in slots] == ["3@image", "9", "171:12"]
def test_list_backfills_schema_for_workflows_imported_before_detection(client):
conn = get_db(settings.db_path)
try:
cur = conn.execute(
"INSERT INTO workflows"
" (name, kind, workflow_json, input_schema, output_schema, is_enabled)"
" VALUES (?, 'image', ?, '[]', '[]', 1)",
("旧导入·Qwen", json.dumps(_load("qwen_image_t2i_API.json"))),
)
conn.commit()
wf_id = cur.lastrowid
finally:
conn.close()
wf = client.get(f"/api/workflows/{wf_id}").json()
assert _by_role(wf["input_schema"])["prompt"]["nodeId"] == "6"
listed = next(w for w in client.get("/api/workflows").json() if w["id"] == wf_id)
assert len(listed["input_schema"]) == len(wf["input_schema"])
def test_native_workflow_full_chain(client, fake_comfy): # noqa: F811
"""导入原生 Qwen 工作流 → 填参 → 生成 → ComfyUI 收到改写后的节点 → 历史可见."""
with _real_run(client, fake_comfy):
wf_id = _import_workflow(
client, "原生·Qwen 文生图", "image", _load("qwen_image_t2i_API.json")
)
wf = client.get(f"/api/workflows/{wf_id}").json()
roles = _by_role(wf["input_schema"])
r = client.post(
"/api/playground/generate",
json={
"workflow_id": wf_id,
"input_values": {
roles["prompt"]["nodeId"]: "雨夜霓虹街道",
roles["seed"]["nodeId"]: 99,
roles["width"]["nodeId"]: 1024,
roles["height"]["nodeId"]: 768,
},
"source": "studio-image",
"endpoint_id": settings.comfyui_active_id,
},
)
assert r.status_code == 200, r.text
job = _wait_done(client, r.json()["job"]["id"])
assert job["status"] == "done", job.get("error")
queued = fake_comfy.prompts[-1]["prompt"]
assert queued["6"]["inputs"]["text"] == "雨夜霓虹街道"
assert queued["3"]["inputs"]["seed"] == 99
assert queued["58"]["inputs"]["width"] == 1024
assert queued["58"]["inputs"]["height"] == 768
assert queued["3"]["inputs"]["positive"] == ["6", 0]
history = client.get("/api/playground/jobs").json()
assert any(j["id"] == job["id"] and j["status"] == "done" for j in history)
def test_real_qwen21_t2i_full_chain(client, fake_comfy): # noqa: F811
with _real_run(client, fake_comfy):
wf_id = _import_workflow(
client, "真实·Qwen2.1 文生图", "image", _load("wen_sheng_tu_API.json")
)
roles = _by_role(client.get(f"/api/workflows/{wf_id}").json()["input_schema"])
r = client.post(
"/api/playground/generate",
json={
"workflow_id": wf_id,
"input_values": {
roles["prompt"]["nodeId"]: "雨夜霓虹街道",
roles["negative"]["nodeId"]: "低清晰度",
roles["seed"]["nodeId"]: 7,
},
"source": "studio-image",
"endpoint_id": settings.comfyui_active_id,
},
)
assert r.status_code == 200, r.text
job = _wait_done(client, r.json()["job"]["id"])
assert job["status"] == "done", job.get("error")
queued = fake_comfy.prompts[-1]["prompt"]
assert queued["459:452"]["inputs"]["prompt"] == "雨夜霓虹街道"
assert queued["459:452"]["inputs"]["negative_prompt"] == "低清晰度"
assert queued["459:458"]["inputs"]["seed"] == 7
assert queued["459:458"]["inputs"]["negative"] == ["459:452", 1]
def test_comfy_rejection_is_reported_in_chinese(client, fake_comfy): # noqa: F811
fake_comfy.fail_prompt = True
with _real_run(client, fake_comfy):
wf_id = _import_workflow(
client, "原生·Qwen(拒绝)", "image", _load("qwen_image_t2i_API.json")
)
r = client.post(
"/api/playground/generate",
json={"workflow_id": wf_id, "input_values": {"6": "x"}, "source": "studio-image"},
)
job = _wait_done(client, r.json()["job"]["id"])
assert job["status"] == "failed"
assert "ComfyUI 拒绝执行该工作流" in job["error"]
assert "HTTP 500" in job["error"]
def test_generate_unknown_workflow_has_chinese_detail(client):
r = client.post("/api/playground/generate", json={"workflow_id": 987654, "input_values": {}})
assert r.status_code == 404
assert "工作流不存在" in r.json()["detail"]
+22
View File
@@ -161,6 +161,28 @@ async function api<T>(path: string, init?: RequestInit): Promise<T> {
return res.json() as Promise<T>;
}
/** Readable text for an api() failure: FastAPI `detail`, not the raw "400: {json}". */
export function apiErrorMessage(err: unknown): string {
if (err instanceof TypeError) return t("api.networkError");
const raw = err instanceof Error ? err.message : String(err);
const m = /^(\d{3}): ([\s\S]*)$/.exec(raw);
if (!m) return raw;
try {
const detail = (JSON.parse(m[2]) as { detail?: unknown }).detail;
if (typeof detail === "string" && detail) return detail;
if (Array.isArray(detail) && detail.length) {
return detail
.map((d) =>
d && typeof d === "object" && "msg" in d ? String(d.msg) : String(d),
)
.join(";");
}
} catch {
/* non-JSON body */
}
return t("api.httpError", { status: m[1], detail: m[2].slice(0, 200) });
}
/** Multipart variant of api() — FormData sets its own Content-Type boundary. */
async function apiUpload<T>(path: string, form: FormData): Promise<T> {
const res = await fetch(`${API_BASE}${path}`, { method: "POST", body: form });
+1 -1
View File
@@ -9,7 +9,7 @@ const TEXT_AREA = new Set([
'PrimitiveString',
]);
const NUMBER = new Set(['INT', 'FLOAT', 'PrimitiveInt', 'PrimitiveFloat', 'KSampler', 'KSamplerAdvanced']);
const IMAGE = new Set(['LoadImage', 'ImageLoader', 'ETN_LoadImageBase64']);
const IMAGE = new Set(['LoadImage', 'LoadImageMask', 'ImageLoader', 'ETN_LoadImageBase64']);
const IMAGE_URL = new Set(['Load Image From Url (mtb)']);
const AUDIO = new Set(['LoadAudio', 'VHS_LoadAudio']);
const VIDEO = new Set(['LoadVideo', 'VHS_LoadVideo', 'VHS_LoadVideoPath']);
+2
View File
@@ -9,6 +9,8 @@ export interface ComfyDynamicInput {
kind: ComfyInputKind;
defaultValue?: string | number;
required: boolean;
/** Inferred from node classes/wiring — the workflow carries no (Input) tags. */
auto?: boolean;
}
export interface ComfyDynamicOutput {
@@ -7,8 +7,18 @@
import ImageLightbox from '$lib/components/ImageLightbox.svelte';
import MediaSlot from '$lib/components/studio/MediaSlot.svelte';
import { toStore } from 'svelte/store';
import { tick } from 'svelte';
import AppShell from '$lib/components/shell/AppShell.svelte';
import { assetUrl, comfy, jobsApi, playgroundApi, settings, workflows, type Job } from '$lib/api';
import {
apiErrorMessage,
assetUrl,
comfy,
jobsApi,
playgroundApi,
settings,
workflows,
type Job,
} from '$lib/api';
import type { ComfyDynamicInput } from '$lib/comfy/types';
import { compactInputValues, isPromptLikeInput } from '$lib/comfy/promptInput';
import { parseDbTs } from '$lib/dbtime';
@@ -67,10 +77,20 @@
.flatMap((j) => j.output_paths.map((p) => ({ job: j, path: p, key: `${j.id}:${p}` }))),
);
// Jobs enqueued from this window — a fast failure can land before the
// jobs list refetch knows about them.
const submittedIds = new Set<number>();
// Live progress via SSE + fallback polling.
$effect(() => {
const off = connectEvents((ev) => {
handleJobEvent(ev);
if (ev.type === 'job.failed' && !ev.data.cancelled) {
const id = Number(ev.data.job_id);
if (submittedIds.has(id) || kindJobs.some((j) => j.id === id)) {
toast.error(t('studio.jobFailedToast', { detail: String(ev.data.error ?? '') }));
}
}
if (ev.type.startsWith('job.') || ev.type === 'events.resync') {
void client.invalidateQueries({ queryKey: ['playground-jobs'] });
void client.invalidateQueries({ queryKey: ['jobs'] });
@@ -350,8 +370,21 @@
// Submit
// ------------------------------------------------------------------
async function submit() {
if (submitting) return;
showErrors = true;
if (Object.keys(errors).length || !workflowId || submitting) return;
if (!workflowId) {
toast.error(t('studio.errNoWorkflow'));
return;
}
const blocking = Object.values(errors).find((m) => m.trim());
if (blocking) {
toast.error(t('studio.errBlocked', { reason: blocking }));
await tick();
document
.querySelector('.param-col .invalid, .param-col .f-error')
?.scrollIntoView({ block: 'center', behavior: 'smooth' });
return;
}
submitting = true;
try {
const res = await playgroundApi.generate({
@@ -360,12 +393,13 @@
endpoint_id: endpointId || null,
source: kind === 'image' ? 'studio-image' : 'studio-video',
});
submittedIds.add(res.job.id);
selectedKey = null;
toast.success(t('studio.queuedToast', { name: selectedEndpointName || '—' }));
await client.invalidateQueries({ queryKey: ['playground-jobs'] });
await client.invalidateQueries({ queryKey: ['jobs'] });
void res;
} catch (err) {
toast.error(err instanceof Error ? err.message : String(err));
toast.error(t('studio.submitFailedToast', { detail: apiErrorMessage(err) }));
} finally {
submitting = false;
}
@@ -715,6 +749,11 @@
<option value={wf.id}>{wf.name}</option>
{/each}
</select>
{#if currentWorkflow && !schema.length}
<p class="missing-note">{t('studio.wfNoParamsNote')}</p>
{:else if schema.some((i) => i.auto)}
<p class="missing-note">{t('studio.wfAutoParamsNote', { n: schema.length })}</p>
{/if}
</div>
{#if mediaSlots.length}
@@ -781,6 +820,16 @@
<span class="f-error">{errors[promptInp.nodeId]}</span>
{/if}
</label>
{:else if currentWorkflow}
<label class="f-field">
<span class="f-label">{t('studio.promptLabel')}</span>
<textarea
class="f-input prompt-area"
rows="3"
disabled
placeholder={t('studio.promptNotDeclared')}
></textarea>
</label>
{/if}
<div class="pair-row">
+13 -1
View File
@@ -164,6 +164,8 @@ export const de: Dict = {
// --- API errors ---
'api.unknownError': 'Etwas ist schiefgelaufen',
'api.networkError': 'Backend nicht erreichbar – prüfe, ob es läuft, und versuche es erneut',
'api.httpError': 'Anfrage fehlgeschlagen (HTTP {status}): {detail}',
'playground.openFailed': 'Playground konnte nicht geöffnet werden',
'playground.opening': 'Playground wird geöffnet…',
'agents.opening': 'Agent wird geöffnet…',
@@ -1387,7 +1389,9 @@ export const de: Dict = {
'conn.wfParams': '{n} ausfüllbare Parameter',
'conn.wfImport': 'Workflow importieren',
'conn.wfImporting': 'Importiere…',
'conn.wfImported': 'Workflow importiert',
'conn.wfNodes': '{n} Knoten',
'conn.wfImportedN': 'Workflow importiert – {n} Parameter erkannt',
'conn.wfImportedNoParams': 'Workflow importiert, aber keine ausfüllbaren Parameter erkannt: er läuft mit seinen eingebauten Einstellungen',
'conn.wfImportFailed': 'Import fehlgeschlagen: {detail}',
'conn.wfImportTitle': 'ComfyUI-Workflow importieren (API-Format-JSON)',
'conn.wfImportHint': 'Einfügen oder Datei wählen; Name ist Pflicht, die Art entscheidet über Bild- oder Video-Fenster.',
@@ -1487,6 +1491,14 @@ export const de: Dict = {
'studio.retryLink': 'Erneut versuchen',
'studio.retryQueuedToast': 'Aufgabe wieder eingereiht',
'studio.retryFailedToast': 'Erneut Einreihen fehlgeschlagen: {detail}',
'studio.errNoWorkflow': 'Bitte zuerst einen Workflow wählen',
'studio.errBlocked': 'Senden nicht möglich: {reason}',
'studio.queuedToast': 'An „{name}“ gesendet, in der Warteschlange',
'studio.submitFailedToast': 'Senden fehlgeschlagen: {detail}',
'studio.jobFailedToast': 'Generierung fehlgeschlagen: {detail}',
'studio.wfNoParamsNote': 'Dieser Workflow hat keine ausfüllbaren Parameter und läuft mit eingebautem Prompt und Einstellungen. Um sie hier auszufüllen, Knotentitel in ComfyUI mit (Input:prompt) usw. markieren und neu importieren.',
'studio.wfAutoParamsNote': 'Keine (Input:…)-Titelmarken – {n} Parameter anhand der Knotentypen erkannt; leere Felder behalten die Workflow-Werte.',
'studio.promptNotDeclared': 'Dieser Workflow hat keinen Prompt-Knoten',
'studio.cancelToast': 'Abbruch angefordert',
'studio.deleteBtn': 'Löschen',
'studio.delTitle': 'Aufgabeneintrag löschen',
+13 -1
View File
@@ -164,6 +164,8 @@ export const en = {
// --- API errors ---
'api.unknownError': 'Something went wrong',
'api.networkError': 'Cannot reach the workbench backend — check that it is running and retry',
'api.httpError': 'Request failed (HTTP {status}): {detail}',
'playground.openFailed': 'Failed to open playground',
'playground.opening': 'Opening playground…',
'agents.opening': 'Opening agent…',
@@ -1387,7 +1389,9 @@ export const en = {
'conn.wfParams': '{n} fillable parameters',
'conn.wfImport': 'Import workflow',
'conn.wfImporting': 'Importing…',
'conn.wfImported': 'Workflow imported',
'conn.wfNodes': '{n} nodes',
'conn.wfImportedN': 'Workflow imported — {n} fillable parameters detected',
'conn.wfImportedNoParams': 'Workflow imported, but no fillable parameters were detected: it will run with its built-in settings',
'conn.wfImportFailed': 'Import failed: {detail}',
'conn.wfImportTitle': 'Import ComfyUI workflow (API-format JSON)',
'conn.wfImportHint': 'Paste or pick a file; name is required, the kind decides whether it shows in the image or video window.',
@@ -1486,6 +1490,14 @@ export const en = {
'studio.retryLink': 'Retry',
'studio.retryQueuedToast': 'Task re-queued',
'studio.retryFailedToast': 'Re-queue failed: {detail}',
'studio.errNoWorkflow': 'Choose a workflow first',
'studio.errBlocked': 'Cannot submit: {reason}',
'studio.queuedToast': 'Submitted to “{name}”, queued',
'studio.submitFailedToast': 'Submit failed: {detail}',
'studio.jobFailedToast': 'Generation failed: {detail}',
'studio.wfNoParamsNote': 'This workflow has no fillable parameters and will run with its built-in prompt and settings. To fill them here, tag node titles with (Input:prompt) etc. in ComfyUI and re-import.',
'studio.wfAutoParamsNote': 'No (Input:…) title tags found — {n} parameters were detected from node types; blank fields keep the workflow values.',
'studio.promptNotDeclared': 'This workflow has no prompt node — nothing to fill',
'studio.cancelToast': 'Cancel requested',
'studio.deleteBtn': 'Delete',
'studio.delTitle': 'Delete task record',
+13 -1
View File
@@ -164,6 +164,8 @@ export const es: Dict = {
// --- API errors ---
'api.unknownError': 'Algo salió mal',
'api.networkError': 'No se puede conectar con el backend; comprueba que esté en marcha y reintenta',
'api.httpError': 'La solicitud falló (HTTP {status}): {detail}',
'playground.openFailed': 'No se pudo abrir el playground',
'playground.opening': 'Abriendo el playground…',
'agents.opening': 'Abriendo el agente…',
@@ -1387,7 +1389,9 @@ export const es: Dict = {
'conn.wfParams': '{n} parámetros rellenables',
'conn.wfImport': 'Importar flujo',
'conn.wfImporting': 'Importando…',
'conn.wfImported': 'Flujo importado',
'conn.wfNodes': '{n} nodos',
'conn.wfImportedN': 'Flujo importado: {n} parámetros detectados',
'conn.wfImportedNoParams': 'Flujo importado, pero sin parámetros rellenables: se ejecutará con su configuración interna',
'conn.wfImportFailed': 'Error al importar: {detail}',
'conn.wfImportTitle': 'Importar flujo de ComfyUI (JSON en formato API)',
'conn.wfImportHint': 'Pega o elige un archivo; el nombre es obligatorio y el tipo decide si aparece en la ventana de imagen o vídeo.',
@@ -1487,6 +1491,14 @@ export const es: Dict = {
'studio.retryLink': 'Reintentar',
'studio.retryQueuedToast': 'Tarea vuelta a la cola',
'studio.retryFailedToast': 'Error al reencolar: {detail}',
'studio.errNoWorkflow': 'Elige primero un flujo',
'studio.errBlocked': 'No se puede enviar: {reason}',
'studio.queuedToast': 'Enviado a «{name}», en cola',
'studio.submitFailedToast': 'Error al enviar: {detail}',
'studio.jobFailedToast': 'La generación falló: {detail}',
'studio.wfNoParamsNote': 'Este flujo no tiene parámetros rellenables y se ejecutará con su prompt y ajustes internos. Para rellenarlos aquí, etiqueta los títulos de nodo con (Input:prompt) etc. en ComfyUI y vuelve a importar.',
'studio.wfAutoParamsNote': 'Sin etiquetas (Input:…): se detectaron {n} parámetros por tipo de nodo; los campos vacíos conservan los valores del flujo.',
'studio.promptNotDeclared': 'Este flujo no tiene nodo de prompt',
'studio.cancelToast': 'Cancelación solicitada',
'studio.deleteBtn': 'Eliminar',
'studio.delTitle': 'Eliminar registro de tarea',
+13 -1
View File
@@ -164,6 +164,8 @@ export const fr: Dict = {
// --- API errors ---
'api.unknownError': "Une erreur s'est produite",
'api.networkError': 'Impossible de joindre le backend : vérifiez qu\'il tourne puis réessayez',
'api.httpError': 'Échec de la requête (HTTP {status}) : {detail}',
'playground.openFailed': "Échec de l'ouverture du bac à sable",
'playground.opening': 'Ouverture du bac à sable…',
'agents.opening': "Ouverture de l'agent…",
@@ -1387,7 +1389,9 @@ export const fr: Dict = {
'conn.wfParams': '{n} paramètres remplissables',
'conn.wfImport': 'Importer le workflow',
'conn.wfImporting': 'Import…',
'conn.wfImported': 'Workflow importé',
'conn.wfNodes': '{n} nœuds',
'conn.wfImportedN': 'Workflow importé : {n} paramètres détectés',
'conn.wfImportedNoParams': 'Workflow importé, mais aucun paramètre détecté : il sera exécuté avec ses réglages intégrés',
'conn.wfImportFailed': 'Échec de l\'import : {detail}',
'conn.wfImportTitle': 'Importer un workflow ComfyUI (JSON format API)',
'conn.wfImportHint': 'Collez ou choisissez un fichier ; le nom est requis, le type décide de la fenêtre image ou vidéo.',
@@ -1487,6 +1491,14 @@ export const fr: Dict = {
'studio.retryLink': 'Réessayer',
'studio.retryQueuedToast': 'Tâche remise en file',
'studio.retryFailedToast': 'Échec de la remise en file : {detail}',
'studio.errNoWorkflow': 'Choisissez d\'abord un workflow',
'studio.errBlocked': 'Envoi impossible : {reason}',
'studio.queuedToast': 'Envoyé à « {name} », en file',
'studio.submitFailedToast': 'Échec de l\'envoi : {detail}',
'studio.jobFailedToast': 'Échec de la génération : {detail}',
'studio.wfNoParamsNote': 'Ce workflow n\'a aucun paramètre à remplir et sera exécuté avec son prompt et ses réglages intégrés. Pour les remplir ici, ajoutez (Input:prompt) etc. aux titres de nœuds dans ComfyUI puis réimportez.',
'studio.wfAutoParamsNote': 'Aucune balise (Input:…) : {n} paramètres détectés par type de nœud ; les champs vides gardent les valeurs du workflow.',
'studio.promptNotDeclared': 'Ce workflow n\'a pas de nœud de prompt',
'studio.cancelToast': 'Annulation demandée',
'studio.deleteBtn': 'Supprimer',
'studio.delTitle': 'Supprimer la tâche',
+13 -1
View File
@@ -164,6 +164,8 @@ export const ja: Dict = {
// --- API errors ---
'api.unknownError': '問題が発生しました',
'api.networkError': 'ワークベンチのバックエンドに接続できません。起動を確認して再試行してください',
'api.httpError': 'リクエスト失敗(HTTP {status}):{detail}',
'playground.openFailed': 'プレイグラウンドを開けませんでした',
'playground.opening': 'プレイグラウンドを開いています…',
'agents.opening': 'エージェントを開いています…',
@@ -1387,7 +1389,9 @@ export const ja: Dict = {
'conn.wfParams': '記入可能パラメータ {n} 件',
'conn.wfImport': 'ワークフローを取り込む',
'conn.wfImporting': '取り込み中…',
'conn.wfImported': 'ワークフローを取り込みました',
'conn.wfNodes': '{n} ノード',
'conn.wfImportedN': 'ワークフローを取り込みました(記入可能パラメータ {n} 件)',
'conn.wfImportedNoParams': '取り込みましたが記入可能パラメータは検出されませんでした。内蔵設定のまま実行されます',
'conn.wfImportFailed': '取り込みに失敗しました:{detail}',
'conn.wfImportTitle': 'ComfyUI ワークフローを取り込む(API 形式 JSON)',
'conn.wfImportHint': '貼り付けまたはファイル選択。名前は必須で、種類が画像 / 動画ウィンドウのどちらに表示されるかを決めます。',
@@ -1487,6 +1491,14 @@ export const ja: Dict = {
'studio.retryLink': '再試行',
'studio.retryQueuedToast': 'タスクを再びキューに入れました',
'studio.retryFailedToast': '再キュー失敗:{detail}',
'studio.errNoWorkflow': '先にワークフローを選択してください',
'studio.errBlocked': '送信できません:{reason}',
'studio.queuedToast': '「{name}」に送信しました(待機中)',
'studio.submitFailedToast': '送信失敗:{detail}',
'studio.jobFailedToast': '生成失敗:{detail}',
'studio.wfNoParamsNote': 'このワークフローには記入可能なパラメータがなく、内蔵のプロンプトと設定で実行されます。ここで記入するには ComfyUI でノードタイトルに (Input:prompt) などを付けて再度取り込んでください。',
'studio.wfAutoParamsNote': '(Input:…) タグがないため、ノード種別から {n} 件のパラメータを自動検出しました。空欄はワークフローの値を使います。',
'studio.promptNotDeclared': 'このワークフローにはプロンプトノードがありません',
'studio.cancelToast': 'キャンセルを要求しました',
'studio.deleteBtn': '削除',
'studio.delTitle': 'タスク記録を削除',
+13 -1
View File
@@ -164,6 +164,8 @@ export const ko: Dict = {
// --- API errors ---
'api.unknownError': '문제가 발생했습니다',
'api.networkError': '워크벤치 백엔드에 연결할 수 없습니다. 실행 중인지 확인 후 다시 시도하세요',
'api.httpError': '요청 실패 (HTTP {status}): {detail}',
'playground.openFailed': '플레이그라운드를 열지 못했습니다',
'playground.opening': '플레이그라운드 여는 중…',
'agents.opening': '에이전트 여는 중…',
@@ -1387,7 +1389,9 @@ export const ko: Dict = {
'conn.wfParams': '채울 수 있는 매개변수 {n}개',
'conn.wfImport': '워크플로 가져오기',
'conn.wfImporting': '가져오는 중…',
'conn.wfImported': '워크플로를 가져왔습니다',
'conn.wfNodes': '노드 {n}개',
'conn.wfImportedN': '워크플로를 가져왔습니다 — 매개변수 {n}개 감지',
'conn.wfImportedNoParams': '가져왔지만 채울 수 있는 매개변수가 없습니다. 내장 설정으로 실행됩니다',
'conn.wfImportFailed': '가져오기 실패: {detail}',
'conn.wfImportTitle': 'ComfyUI 워크플로 가져오기(API 형식 JSON)',
'conn.wfImportHint': '붙여넣기 또는 파일 선택. 이름은 필수이며 종류가 이미지/동영상 창 표시를 결정합니다.',
@@ -1487,6 +1491,14 @@ export const ko: Dict = {
'studio.retryLink': '재시도',
'studio.retryQueuedToast': '작업이 다시 대기열에 들어갔습니다',
'studio.retryFailedToast': '재대기열 실패: {detail}',
'studio.errNoWorkflow': '먼저 워크플로를 선택하세요',
'studio.errBlocked': '제출할 수 없음: {reason}',
'studio.queuedToast': '“{name}”에 제출됨, 대기 중',
'studio.submitFailedToast': '제출 실패: {detail}',
'studio.jobFailedToast': '생성 실패: {detail}',
'studio.wfNoParamsNote': '이 워크플로에는 채울 매개변수가 없어 내장 프롬프트와 설정으로 실행됩니다. 여기서 입력하려면 ComfyUI에서 노드 제목에 (Input:prompt) 등을 붙인 뒤 다시 가져오세요.',
'studio.wfAutoParamsNote': '(Input:…) 제목 태그가 없어 노드 유형으로 매개변수 {n}개를 자동 감지했습니다. 빈 칸은 워크플로 값을 유지합니다.',
'studio.promptNotDeclared': '이 워크플로에는 프롬프트 노드가 없습니다',
'studio.cancelToast': '취소를 요청했습니다',
'studio.deleteBtn': '삭제',
'studio.delTitle': '작업 기록 삭제',
+13 -1
View File
@@ -164,6 +164,8 @@ export const zh: Dict = {
// --- API errors ---
'api.unknownError': '出错了',
'api.networkError': '无法连接到工作台后端,请确认服务在运行、网络正常后重试',
'api.httpError': '请求失败(HTTP {status}):{detail}',
'playground.openFailed': '无法打开演练场',
'playground.opening': '正在打开演练场……',
'agents.opening': '正在打开智能体……',
@@ -1387,7 +1389,9 @@ export const zh: Dict = {
'conn.wfParams': '{n} 个可填参数',
'conn.wfImport': '导入工作流',
'conn.wfImporting': '导入中…',
'conn.wfImported': '工作流已导入',
'conn.wfNodes': '{n} 个节点',
'conn.wfImportedN': '工作流已导入,识别到 {n} 个可填参数',
'conn.wfImportedNoParams': '工作流已导入,但没有识别到可填参数:生成时将按工作流内置设置运行',
'conn.wfImportFailed': '导入失败:{detail}',
'conn.wfImportTitle': '导入 ComfyUI 工作流(API 格式 JSON)',
'conn.wfImportHint': '粘贴或选择文件;名称必填,分类决定它出现在生图还是生视频窗口。',
@@ -1486,6 +1490,14 @@ export const zh: Dict = {
'studio.retryLink': '重试',
'studio.retryQueuedToast': '任务已重新排队',
'studio.retryFailedToast': '重新排队失败:{detail}',
'studio.errNoWorkflow': '请先选择工作流',
'studio.errBlocked': '无法提交:{reason}',
'studio.queuedToast': '已提交到「{name}」,排队中',
'studio.submitFailedToast': '提交失败:{detail}',
'studio.jobFailedToast': '生成失败:{detail}',
'studio.wfNoParamsNote': '该工作流没有可填写的参数,将按工作流内置的提示词和设置直接生成。如需在这里填写,请在 ComfyUI 中把节点标题加上 (Input:prompt) 等标记后重新导入。',
'studio.wfAutoParamsNote': '工作流未使用 (Input:…) 标题标记,已按节点类型自动识别出 {n} 个参数;留空的项沿用工作流原值。',
'studio.promptNotDeclared': '该工作流没有提示词节点,无需填写',
'studio.cancelToast': '已发送取消请求',
'studio.deleteBtn': '删除',
'studio.delTitle': '删除任务记录',
@@ -372,9 +372,11 @@
...(wfImportEndpoint ? { endpoint_id: wfImportEndpoint } : {}),
});
},
onSuccess: () => {
onSuccess: (wf) => {
client.invalidateQueries({ queryKey: ['workflows'] });
toast.success(t('conn.wfImported'));
const n = wf.input_schema?.length ?? 0;
if (n) toast.success(t('conn.wfImportedN', { n }));
else toast.info(t('conn.wfImportedNoParams'));
wfImportOpen = false;
wfJsonText = '';
wfImportName = '';
@@ -724,7 +726,7 @@
<div class="form-actions">
<span class="need-test" class:passed={wfParsed.valid && wfImportName.trim() !== ''}>
{wfParsed.valid
? t('conn.wfParams', { n: Object.keys(wfParsed.json ?? {}).length })
? t('conn.wfNodes', { n: Object.keys(wfParsed.json ?? {}).length })
: 'JSON'}
</span>
<Button