runpod-comfyui-models

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Repair a ComfyUI workflow for RunpodDirect

修复适用于RunpodDirect的ComfyUI工作流

Return a new UI workflow JSON containing trustworthy
properties.models
records that ComfyUI-RunpodDirect can consume — never substitute a plausible model merely to make the graph queue. Never edit, replace, or overwrite the supplied JSON or PNG. For every recoverable UI workflow, hand off exactly one new
<workflow-stem>.repaired.json
— even when resolution is incomplete, ambiguous, gated, or interrupted.
返回包含可靠
properties.models
记录的新UI工作流JSON文件,供ComfyUI-RunpodDirect使用——切勿仅为了让图队列运行而替换看似合理的模型。绝不编辑、替换或覆盖提供的JSON或PNG文件。对于每个可恢复的UI工作流,仅交付一个新的
<workflow-stem>.repaired.json
文件——即使解析不完整、存在歧义、受权限限制或被中断,也需如此。

Terms — workflow vs prompt vs metadata record

术语定义——工作流、提示词与元数据记录

TermWhat it isRole here
UI workflow JSONThe graph the ComfyUI frontend exports/imports: nodes, links, widget values,
properties
the only JSON this skill annotates
API
prompt
JSON
The execution format POSTed to
/prompt
, keyed by node id
inventory evidence only — never annotate it
properties.models
record
A loader node's model metadata entry (
name
,
url
,
directory
, optional
hash
)
what a repair adds or fixes
Annotation targets the UI format only; the API prompt has no portable model-metadata contract.
术语定义在此处的作用
UI工作流JSONComfyUI前端导出/导入的图谱:节点、链接、组件值、
properties
此技能仅标注该格式的JSON
API
prompt
JSON
提交至
/prompt
的执行格式,按节点ID索引
仅作为清点依据——绝不标注该格式
properties.models
记录
加载器节点的模型元数据条目(
name
url
directory
,可选
hash
修复时需要添加或修正的内容
仅针对UI格式进行标注;API提示词不存在可移植的模型元数据约定。

Intake

接收流程

  • No artifact yet → ask exactly once: “Please attach the workflow JSON or the original ComfyUI output PNG.” (Screenshots and re-encoded images usually lose the workflow.)
  • Artifact present → no further intake questions: extract when needed, inventory, resolve, write the repaired copy, return it.
  • No recoverable UI workflow (API-only JSON, stripped PNG) → that is the single blocker; request the original UI workflow or PNG.
  • 未提交工件→仅询问一次:“请附上工作流JSON文件或原始ComfyUI输出PNG文件。”(截图和重新编码的图片通常会丢失工作流信息。)
  • 已提交工件→无需进一步询问:按需提取、清点、解析、生成修复后的副本并返回。
  • 无可恢复的UI工作流(仅API格式JSON、已剥离工作流的PNG)→这是唯一的障碍;请用户提供原始UI工作流或PNG文件。

Decide the path

选择处理路径

Observed stateAction
Every model requirement has complete metadata with no reported issuesPreserve its content unchanged, write the one new final JSON, and report that no records were added. Verify or harden only when explicitly requested or when a live failure provides evidence of a problem.
Exact filename but no trustworthy URLInventory node context, then resolve candidates from original template sources, ComfyUI-Manager, Hugging Face, or Civitai.
Generic filename or several credible matchesDo not apply ambiguous metadata or download. Publish the partial workflow, report its path, then show the candidates and ask the user to choose.
Gated or license-restricted artifactPublish the partial workflow first, then stop before authentication/download until access and license acceptance are confirmed.
RunpodDirect routes unavailableProduce the repaired workflow; keep its working manifest temporary and recommend or diagnose RunpodDirect only when the environment warrants it.
观测状态操作
所有模型需求均包含完整元数据且无问题反馈保持内容不变,生成一个新的最终JSON文件,并告知未添加任何记录。仅在明确要求或实际运行失败提供问题证据时,才进行验证或强化处理。
文件名准确但无可靠URL清点节点上下文,然后从原始模板源、ComfyUI-Manager、Hugging Face或Civitai中匹配候选模型。
文件名通用或存在多个可信匹配项切勿添加歧义元数据或下载模型。先发布部分修复的工作流,说明处理进度,然后展示候选模型并请用户选择。
工件受权限或许可证限制先发布部分修复的工作流,然后在确认用户获得访问权限并接受许可证之前,停止认证/下载操作。
RunpodDirect路由不可用生成修复后的工作流;临时保留可用清单,仅当环境需要时才推荐或诊断RunpodDirect。

The references

参考文档

ReferenceThe one question it answers
reference/resolution.mdWhich exact artifact is this model? Evidence, source order, confidence policy.
reference/metadata.mdHow is approved metadata written into the workflow? Patch rules, unsafe-URL handling, the exact handoff lines.
reference/runpoddirect.mdIs the live extension there, and how is it driven safely? Feature detection, download authorization, URL/redirect/secret safety.
参考文档解答的核心问题
reference/resolution.md该模型对应的具体工件是什么?依据、来源优先级、可信度规则。
reference/metadata.md如何将已核准的元数据写入工作流?补丁规则、不安全URL处理、交付格式规范。
reference/runpoddirect.md实时扩展是否存在,以及如何安全调用?功能检测、下载授权、URL/重定向/密钥安全。

Low-friction contract

低摩擦约定

  • inspect / check → read-only work.
  • find / repair / fix → also write the new repaired copy.
  • download / make it work on this Pod → also download verified public unchanged tuples.
  • run / test end to end → plus one controlled smoke test.
Never reconfirm a step the opening intent already covered. Ask once, and only for a material decision: ambiguity, gated access or a license, an install or restart, a cost/storage choice, or an action beyond the opening request. If no decision remains, finish the authorized work and report once — an optional next step is not a question.
  • inspect / check → 仅执行只读操作。
  • find / repair / fix → 同时生成新的修复副本。
  • download / make it work on this Pod → 同时下载已验证的公开未修改模型元组。
  • run / test end to end → 额外执行一次受控冒烟测试。
无需重新确认初始请求已涵盖的步骤。仅在需要关键决策时询问一次:如存在歧义、受权限或许可证限制、需要安装或重启、涉及成本/存储选择,或操作超出初始请求范围。若无需决策,则完成已授权的工作并仅汇报一次——可选的下一步操作无需询问。

Workflow

工作流步骤

  1. Extract (PNG input only):
    python3 -B extract_png_workflow.py
    pulls the embedded UI
    workflow
    from a ComfyUI output PNG into the task's temporary directory.
  2. Inventory:
    python3 -B inventory_workflow_models.py
    lists every loader selection, subgraphs included — evidence, never an identity decision.
  3. Resolve each identity per reference/resolution.md, stopping at the first
    verified
    publisher artifact; keep the review manifest temporary.
  4. Apply:
    python3 -B apply_model_metadata.py --allow-unresolved
    writes the new workflow every time, even when nothing could be resolved; patch rules, unsafe-URL handling, and the publish contract live in reference/metadata.md.
  5. Live checks (only within the request's scope): one batched read-only probe of the pod's RunpodDirect routes —
    curl
    is fine, batched rather than a visible sequence — then downloads only as authorized, per reference/runpoddirect.md.
Consult
--help
only after a usage error. Working state (extracted JSON, inventory, manifest) lives in one task-specific temporary directory, deleted after the repaired JSON validates; the repaired JSON is the only persistent artifact. Hand off in plain language — the exact lines are in reference/metadata.md.
  1. 提取(仅针对PNG输入):
    python3 -B extract_png_workflow.py
    从ComfyUI输出PNG中提取嵌入的UI
    workflow
    ,保存至任务临时目录。
  2. 清点
    python3 -B inventory_workflow_models.py
    列出所有加载器选项,包括子图谱——仅作为依据,不做身份判定。
  3. 解析每个模型身份,遵循reference/resolution.md,找到第一个
    verified
    发布者工件时停止;临时保留审核清单。
  4. 应用
    python3 -B apply_model_metadata.py --allow-unresolved
    每次都会生成新的工作流,即使无法解析任何内容;补丁规则、不安全URL处理和发布约定详见reference/metadata.md
  5. 实时检查(仅在请求范围内):对Pod的RunpodDirect路由执行一次批量只读探测——使用
    curl
    即可,采用批量方式而非可见的序列操作——然后仅在获得授权时进行下载,遵循reference/runpoddirect.md
仅在出现使用错误时查看
--help
。工作状态(提取的JSON、清点结果、清单)存储在特定任务的临时目录中,修复后的JSON验证通过后即删除;修复后的JSON是唯一持久化的工件。使用简洁语言交付——具体表述详见reference/metadata.md

Routing onward

任务转导

The task is actually…Send it to
Provision a pod for the workflowgolden path 02 (index: golden paths), then runpod-mcp or runpodctl
Model repo and file already known exactly
companion-clis
A template pod won't boot, or models are missing on a template pod
runpod-templates
Install or understand RunpodDirect itselfreference/runpoddirect.md
实际任务类型转至
为工作流配置Podgolden path 02(索引:golden paths),然后使用runpod-mcp或runpodctl
模型仓库和文件已明确知晓
companion-clis
模板Pod无法启动,或模板Pod上缺失模型
runpod-templates
安装或了解RunpodDirect本身reference/runpoddirect.md