{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"指令编辑","description":"悠船是基于AI的图片生成工具，提供多种图片生成功能，包括图片提示词、图片生成、图片编辑等。"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"指令编辑"},"children":["指令编辑 ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/docs/assets/new-flag.42e5895c9852e792a93f30c7ce489fa55ff07b451b30c0e70fade41a8abd2960.9c1bb791.svg","alt":"新功能标志"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["用自然语言改图：指定参考图，写清「想怎么改」，例如「把这张图改成插画风」「让侧视图变成正视图」。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["通过 ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/export/list#%E6%8C%87%E4%BB%A4%E7%BC%96%E8%BE%91-editdiffusion"},"children":["指令编辑"]},"（",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/tob/edit-diffusion"]},"）提交。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--edit"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["仅该接口支持"]},"，其它接口携带会被拒绝。"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["仅 ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["V8.1 / V8.2"]},"模型支持，请在提示词中明确指明"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"能做什么"},"children":["能做什么"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"场景"},"children":["场景"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"做法"},"children":["做法"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["整图按指令修改 / 多图融合"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--edit"]}," 指定 1–4 张图，文本写如何修改"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["只改画面某一块（擦除、替换、外扩）"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["待改区域做成透明，并打开 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["withTransparentMask"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["与",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/guides/advanced-topics/use_images#%E5%9B%BE%E5%83%8F%E6%8F%90%E7%A4%BA%E8%AF%8D"},"children":["垫图"]},"不同：垫图描述",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["最终画面"]},"；",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--edit"]}," 写的是",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["改图指令"]},"。打开透明遮罩后，效果等同于",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/export/list#%E5%8C%BA%E5%9F%9F%E9%87%8D%E7%BB%98-inpaint"},"children":["区域重绘"]}," / ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/export/list#%E7%BC%96%E8%BE%91-edit"},"children":["编辑"]}," / ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/export/list#%E9%AB%98%E7%BA%A7%E7%BC%96%E8%BE%91-uploadpaint"},"children":["高级编辑"]},"。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"接口参数说明"},"children":["接口参数说明"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"字段"},"children":["字段"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"类型"},"children":["类型"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"必填"},"children":["必填"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"说明"},"children":["说明"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["prompt"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["是"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["提示词，长度 [1-8096]。需包含修改指令；用 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--edit"]}," 指定图片"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["jobId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["否"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["引用的任务ID"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["imageNo"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["提供 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["jobId"]}," 时必填"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["图片编号 [0-23]"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["withTransparentMask"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["bool"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["否"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["是否把 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--edit"]}," 图片中的透明区域识别为待编辑区，默认 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["callback"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["否"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["任务结果回调 URL"]}]}]}]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["提示"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["当某个任务的单张图片进行操作时，建议传入 jobID 和 imageNo，这样模型可以更稳定的参照原图内容进行图片生成"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"提示词规则"},"children":["提示词规则"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<修改指令> --edit <图片URL> [图片URL...] --v 8.1\n"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"规则"},"children":["规则"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"说明"},"children":["说明"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["格式"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--edit"]}," 后跟 1–4 个图片 URL，",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["空格分隔"]},"，不要用逗号"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["不能为空"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--edit"]}," 后面没有 URL 会返回 400"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["不能重复"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["重复 URL 会返回「重复参数」"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["数量上限"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["最多 4 张，超出返回「图片数量不能超过4张」"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["不合并垫图"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["提示词开头的垫图",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["不会"]},"并入 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--edit"]},"；编辑对象必须写在 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--edit"]}," 后面"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["必须有文本"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["要写「如何修改」；多图时写清各图用途（人物 / 服装 / 场景等）"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["图片格式"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["png / jpg / jpeg / webp；单张 ≤ 20MB，边长 ≤ 16k。透明遮罩须用带 Alpha 的 ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PNG"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["其它参数"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["可叠加 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--ar"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--s"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--seed"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--hd"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--sref"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--sw"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--p"]}," 等"]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"把这张图改成插画风 --edit https://example.com/photo.png --v 8.1\n"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"结合第一张的人物、第二张的服装，生成一张完整画面 --edit https://a.example.com/person.png https://b.example.com/outfit.png --v 8.1\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"局部编辑"},"children":["局部编辑"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["设置",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["withTransparentMask参数时"]},"，模型把 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--edit"]}," 图里的透明像素当成「请重绘这里」的遮罩，而不是画面内容。"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Alpha"},"children":["Alpha"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"含义"},"children":["含义"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["< 128"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["待编辑区，按提示词重绘"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["≥ 128"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["保留区，构图和主体尽量不变"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["何时打开："]}," 局部替换、擦除后重绘、把原图缩小/平移后周围露出透明底。整图改风格时保持默认 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"，以免半透明像素被当成遮罩。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["图片要求："]}," 必须是带 Alpha 的 PNG（JPG 无效）；待编辑图画在 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--edit"]}," 第一张"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"prompt\": \"把透明背景换成黄昏海边，保留人物姿态 --edit https://example.com/person-with-hole.png --v 8.1\",\n  \"withTransparentMask\": true\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"其它示例"},"children":["其它示例"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["基于已有任务："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"jobId\": \"12345\",\n  \"imageNo\": 0,\n  \"prompt\": \"改成赛博朋克夜景，保留主体 --edit https://example.com/person-with-hole.png --v 8.1\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["叠加风格参考："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"把人物换成商务正装，整体改为水彩插画风格 --edit https://example.com/person.png --sref https://example.com/watercolor.png --sw 200 --v 8.1\n"},"children":[]}]},"headings":[{"value":"指令编辑","id":"指令编辑","depth":1},{"value":"能做什么","id":"能做什么","depth":2},{"value":"接口参数说明","id":"接口参数说明","depth":2},{"value":"提示词规则","id":"提示词规则","depth":2},{"value":"局部编辑","id":"局部编辑","depth":2},{"value":"其它示例","id":"其它示例","depth":2}],"frontmatter":{"seo":{"title":"指令编辑"}},"lastModified":"2026-09-10T13:08:31.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/advanced-topics/edit_diffusion","userData":{"isAuthenticated":false,"teams":["anonymous"]}}