<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ComfyUI 工作流 JSON 的节点参数要批量修改，脚本怎么写才不把工作流改坏？]]></title><description><![CDATA[<p dir="auto">几十个工作流 JSON 要统一改采样器、步数这些参数，手改容易漏还容易改坏结构。写脚本批量改的话，怎么定位节点、怎么保证改完还能跑？（已采纳，感谢 <a class="plugin-mentions-user plugin-mentions-a" href="/user/storyboard_geek" aria-label="Profile: storyboard_geek">@<bdi>storyboard_geek</bdi></a> 的详细解答）</p>
]]></description><link>https://bbs.zhidahengtong.com/topic/122/comfyui-工作流-json-的节点参数要批量修改-脚本怎么写才不把工作流改坏</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 06:56:06 GMT</lastBuildDate><atom:link href="https://bbs.zhidahengtong.com/topic/122.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 28 Nov 2026 03:45:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ComfyUI 工作流 JSON 的节点参数要批量修改，脚本怎么写才不把工作流改坏？ on Sat, 28 Nov 2026 03:45:08 GMT]]></title><description><![CDATA[<p dir="auto">批量改工作流 JSON 的四条军规：</p>
<ol>
<li><strong>按语义定位，别按序号</strong>：节点在 JSON 里的编号会变。定位用 <code>class_type</code>（如 KSampler）+ <code>title</code>/<code>widgets_values</code> 特征组合，比如"所有 KSampler 且 steps&gt;30 的节点"——比硬编码 node_id 稳得多；</li>
<li><strong>只改叶子值，不动结构</strong>：只写 widgets_values 里的标量（seed/steps/cfg），不增删节点、不改链接数组——结构一动手动都难修；</li>
<li><strong>改完先校验再入库</strong>：用 jsonschema 校验 API 格式的工作流，再 dry-run 提交单张出图验证能跑通，最后才批量应用；</li>
<li><strong>保留原文件</strong>：<code>wf_v2.json</code> 这类副本留着，或干脆 git 管起来——改坏了能 diff 出哪一步动的手。</li>
</ol>
<p dir="auto">脚本骨架：读 JSON → 遍历节点字典 → 条件匹配 → 改值 → 校验 → 写回。50 行以内搞定，别上复杂框架。</p>
]]></description><link>https://bbs.zhidahengtong.com/post/108</link><guid isPermaLink="true">https://bbs.zhidahengtong.com/post/108</guid><dc:creator><![CDATA[storyboard_geek 2]]></dc:creator><pubDate>Sat, 28 Nov 2026 03:45:08 GMT</pubDate></item></channel></rss>