{ "id": "a2143803-dd9d-4fd4-9370-31ce70307498", "revision": 0, "last_node_id": 228, "last_link_id": 350, "nodes": [ { "id": 108, "type": "SamplerCustom", "pos": [ -1350, 4620 ], "size": [ 280, 500 ], "flags": {}, "order": 26, "mode": 0, "showAdvanced": false, "inputs": [ { "name": "model", "type": "MODEL", "link": 213 }, { "name": "positive", "type": "CONDITIONING", "link": 323 }, { "name": "negative", "type": "CONDITIONING", "link": 324 }, { "name": "sampler", "type": "SAMPLER", "link": 185 }, { "name": "sigmas", "type": "SIGMAS", "link": 139 }, { "name": "latent_image", "type": "LATENT", "link": 321 } ], "outputs": [ { "name": "output", "type": "LATENT", "links": [ 322 ] }, { "name": "denoised_output", "type": "LATENT", "links": [] } ], "properties": { "Node name for S&R": "SamplerCustom", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ true, 270186383729385, "randomize", 1 ] }, { "id": 112, "type": "BasicScheduler", "pos": [ -1700, 4990 ], "size": [ 280, 150 ], "flags": {}, "order": 14, "mode": 0, "inputs": [ { "name": "model", "type": "MODEL", "link": 182 } ], "outputs": [ { "name": "SIGMAS", "type": "SIGMAS", "links": [ 139 ] } ], "properties": { "Node name for S&R": "BasicScheduler", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "normal", 28, 1 ] }, { "id": 6, "type": "CheckpointLoaderSimple", "pos": [ -3240, 4620 ], "size": [ 470, 140 ], "flags": {}, "order": 0, "mode": 0, "inputs": [], "outputs": [ { "name": "MODEL", "type": "MODEL", "links": [ 192 ] }, { "name": "CLIP", "type": "CLIP", "links": [ 146, 274 ] }, { "name": "VAE", "type": "VAE", "links": [ 147 ] } ], "properties": { "Node name for S&R": "CheckpointLoaderSimple", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0", "models": [ { "name": "hidream_o1_image_dev_fp8_scaled.safetensors", "url": "https://huggingface.co/Comfy-Org/HiDream-O1-Image/resolve/main/checkpoints/hidream_o1_image_dev_fp8_scaled.safetensors", "directory": "checkpoints" } ] }, "widgets_values": [ "hidream_o1_image_dev_fp8_scaled.safetensors" ] }, { "id": 124, "type": "ModelNoiseScale", "pos": [ -1700, 4620 ], "size": [ 280, 80 ], "flags": {}, "order": 10, "mode": 0, "inputs": [ { "name": "model", "type": "MODEL", "link": 192 } ], "outputs": [ { "name": "MODEL", "type": "MODEL", "links": [ 182, 213 ] } ], "properties": { "Node name for S&R": "ModelNoiseScale", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ 7.6 ] }, { "id": 104, "type": "HiDreamO1ReferenceImages", "pos": [ -2050, 5090 ], "size": [ 250, 120 ], "flags": {}, "order": 23, "mode": 0, "inputs": [ { "name": "positive", "type": "CONDITIONING", "link": 141 }, { "name": "negative", "type": "CONDITIONING", "link": 275 }, { "label": "image_1", "name": "images.image_1", "type": "IMAGE", "link": 300 }, { "label": "image_2", "name": "images.image_2", "shape": 7, "type": "IMAGE", "link": null } ], "outputs": [ { "name": "positive", "type": "CONDITIONING", "links": [ 218 ] }, { "name": "negative", "type": "CONDITIONING", "links": [ 220 ] } ], "properties": { "Node name for S&R": "HiDreamO1ReferenceImages", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [], "color": "#322", "bgcolor": "#533" }, { "id": 110, "type": "CLIPTextEncode", "pos": [ -2540, 4600 ], "size": [ 420, 480 ], "flags": {}, "order": 21, "mode": 0, "inputs": [ { "name": "clip", "type": "CLIP", "link": 146 }, { "name": "text", "type": "STRING", "widget": { "name": "text" }, "link": 327 } ], "outputs": [ { "name": "CONDITIONING", "type": "CONDITIONING", "links": [ 141, 217 ] } ], "properties": { "Node name for S&R": "CLIPTextEncode", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "" ], "color": "#232", "bgcolor": "#353" }, { "id": 105, "type": "VAEDecode", "pos": [ -1320, 5160 ], "size": [ 230, 80 ], "flags": {}, "order": 27, "mode": 0, "inputs": [ { "name": "samples", "type": "LATENT", "link": 322 }, { "name": "vae", "type": "VAE", "link": 147 } ], "outputs": [ { "name": "IMAGE", "type": "IMAGE", "links": [ 347 ] } ], "properties": { "Node name for S&R": "VAEDecode", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [] }, { "id": 125, "type": "SamplerLCM", "pos": [ -1700, 4760 ], "size": [ 280, 160 ], "flags": {}, "order": 1, "mode": 0, "inputs": [], "outputs": [ { "name": "SAMPLER", "type": "SAMPLER", "links": [ 185 ] } ], "properties": { "Node name for S&R": "SamplerLCM", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ 1, 1, 2.5 ] }, { "id": 152, "type": "ComfySwitchNode", "pos": [ -2050, 4660 ], "size": [ 270, 130 ], "flags": {}, "order": 24, "mode": 0, "inputs": [ { "name": "on_false", "type": "CONDITIONING", "link": 217 }, { "name": "on_true", "type": "CONDITIONING", "link": 218 }, { "name": "switch", "type": "BOOLEAN", "widget": { "name": "switch" }, "link": 224 } ], "outputs": [ { "name": "output", "type": "CONDITIONING", "links": [ 323 ] } ], "properties": { "Node name for S&R": "ComfySwitchNode", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ false ] }, { "id": 153, "type": "ComfySwitchNode", "pos": [ -2050, 4840 ], "size": [ 270, 130 ], "flags": {}, "order": 25, "mode": 0, "inputs": [ { "name": "on_false", "type": "CONDITIONING", "link": 276 }, { "name": "on_true", "type": "CONDITIONING", "link": 220 }, { "name": "switch", "type": "BOOLEAN", "widget": { "name": "switch" }, "link": 225 } ], "outputs": [ { "name": "output", "type": "CONDITIONING", "links": [ 324 ] } ], "properties": { "Node name for S&R": "ComfySwitchNode", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ false ] }, { "id": 155, "type": "ComfySwitchNode", "pos": [ -1340, 5360 ], "size": [ 230, 130 ], "flags": {}, "order": 22, "mode": 0, "inputs": [ { "name": "on_false", "type": "LATENT", "link": 233 }, { "name": "on_true", "type": "LATENT", "link": 350 }, { "name": "switch", "type": "BOOLEAN", "widget": { "name": "switch" }, "link": 235 } ], "outputs": [ { "name": "output", "type": "LATENT", "links": [ 321 ] } ], "properties": { "Node name for S&R": "ComfySwitchNode", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ false ] }, { "id": 157, "type": "GetImageSize", "pos": [ -1680, 5730 ], "size": [ 225, 66 ], "flags": { "collapsed": true }, "order": 15, "mode": 0, "inputs": [ { "name": "image", "type": "IMAGE", "link": 318 } ], "outputs": [ { "name": "width", "type": "INT", "links": [ 319 ] }, { "name": "height", "type": "INT", "links": [ 320 ] }, { "name": "batch_size", "type": "INT", "links": null } ], "properties": { "Node name for S&R": "GetImageSize", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [] }, { "id": 154, "type": "PrimitiveBoolean", "pos": [ -3420, 5630 ], "size": [ 270, 80 ], "flags": {}, "order": 2, "mode": 0, "inputs": [], "outputs": [ { "name": "BOOLEAN", "type": "BOOLEAN", "links": [ 224, 225, 235 ] } ], "title": "Switch to Image Edit", "properties": { "Node name for S&R": "PrimitiveBoolean", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ true ] }, { "id": 175, "type": "fa7296b5-c974-4466-bfe3-a1f05f43b880", "pos": [ -3060, 4890 ], "size": [ 430, 180 ], "flags": {}, "order": 13, "mode": 0, "inputs": [ { "label": "user_prompt", "name": "replace", "type": "STRING", "widget": { "name": "replace" }, "link": 260 }, { "name": "image", "shape": 7, "type": "IMAGE", "link": 301 } ], "outputs": [ { "name": "output", "type": "STRING", "links": [ 266 ] } ], "properties": { "proxyWidgets": [ [ "170", "replace" ], [ "167", "clip_name" ] ], "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [] }, { "id": 176, "type": "ComfySwitchNode", "pos": [ -3060, 5110 ], "size": [ 225, 54 ], "flags": { "collapsed": true }, "order": 16, "mode": 0, "inputs": [ { "name": "on_false", "type": "STRING", "link": 267 }, { "name": "on_true", "type": "STRING", "link": 266 }, { "name": "switch", "type": "BOOLEAN", "widget": { "name": "switch" }, "link": 265 } ], "outputs": [ { "name": "output", "type": "STRING", "links": [ 326 ] } ], "properties": { "Node name for S&R": "ComfySwitchNode", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ false ] }, { "id": 177, "type": "PrimitiveBoolean", "pos": [ -3420, 5430 ], "size": [ 270, 80 ], "flags": {}, "order": 3, "mode": 0, "inputs": [], "outputs": [ { "name": "BOOLEAN", "type": "BOOLEAN", "links": [ 265 ] } ], "title": "Enable Prompt Refine?", "properties": { "Node name for S&R": "PrimitiveBoolean", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ false ] }, { "id": 188, "type": "CLIPTextEncode", "pos": [ -2540, 5120 ], "size": [ 420, 120 ], "flags": {}, "order": 11, "mode": 0, "inputs": [ { "name": "clip", "type": "CLIP", "link": 274 } ], "outputs": [ { "name": "CONDITIONING", "type": "CONDITIONING", "links": [ 275, 276 ] } ], "properties": { "Node name for S&R": "CLIPTextEncode", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "" ], "color": "#223", "bgcolor": "#335" }, { "id": 195, "type": "MarkdownNote", "pos": [ -2020, 5960 ], "size": [ 980, 560 ], "flags": {}, "order": 4, "mode": 0, "inputs": [], "outputs": [], "title": "Note: About Image Size", "properties": {}, "widgets_values": [ "Select and Ctrl-B to enable the `ImageScaleToTotalPixels` node, if your input image is too large\n\nThe O1 model is trained under the following resolutions:\n| Width | Height | Category |\n|-------|--------|------------|\n| 2048 | 2048 | Square |\n| 2304 | 1728 | Landscape |\n| 2304 | 1792 | Landscape |\n| 2496 | 1664 | Landscape |\n| 2560 | 1440 | Landscape |\n| 3104 | 1312 | Landscape |\n| 1728 | 2304 | Portrait |\n| 1792 | 2304 | Portrait |\n| 1664 | 2496 | Portrait |\n| 1440 | 2560 | Portrait |\n| 1312 | 3104 | Portrait |" ], "color": "#222", "bgcolor": "#000" }, { "id": 196, "type": "ImageScaleToTotalPixels", "pos": [ -2020, 5710 ], "size": [ 320, 150 ], "flags": {}, "order": 12, "mode": 4, "inputs": [ { "name": "image", "type": "IMAGE", "link": 302 } ], "outputs": [ { "name": "IMAGE", "type": "IMAGE", "links": [ 318 ] } ], "properties": { "Node name for S&R": "ImageScaleToTotalPixels", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "lanczos", 4, 1 ] }, { "id": 213, "type": "LoadImage", "pos": [ -3000, 5420 ], "size": [ 310, 430 ], "flags": {}, "order": 5, "mode": 0, "inputs": [], "outputs": [ { "name": "IMAGE", "type": "IMAGE", "links": [ 300, 301, 302 ] }, { "name": "MASK", "type": "MASK", "links": null } ], "properties": { "Node name for S&R": "LoadImage", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "noir_portrait.png", "image" ] }, { "id": 218, "type": "ComfyMathExpression", "pos": [ -1680, 5780 ], "size": [ 225, 74 ], "flags": { "collapsed": true }, "order": 17, "mode": 0, "inputs": [ { "label": "a", "name": "values.a", "type": "FLOAT,INT,BOOLEAN", "link": 319 }, { "label": "b", "name": "values.b", "shape": 7, "type": "FLOAT,INT,BOOLEAN", "link": null } ], "outputs": [ { "name": "FLOAT", "type": "FLOAT", "links": null }, { "name": "INT", "type": "INT", "links": [ 310 ] }, { "name": "BOOL", "type": "BOOLEAN", "links": null } ], "properties": { "Node name for S&R": "ComfyMathExpression", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "floor(a/32)*32" ] }, { "id": 219, "type": "ComfyMathExpression", "pos": [ -1680, 5830 ], "size": [ 225, 74 ], "flags": { "collapsed": true }, "order": 18, "mode": 0, "inputs": [ { "label": "a", "name": "values.a", "type": "FLOAT,INT,BOOLEAN", "link": 320 }, { "label": "b", "name": "values.b", "shape": 7, "type": "FLOAT,INT,BOOLEAN", "link": null } ], "outputs": [ { "name": "FLOAT", "type": "FLOAT", "links": null }, { "name": "INT", "type": "INT", "links": [ 311 ] }, { "name": "BOOL", "type": "BOOLEAN", "links": null } ], "properties": { "Node name for S&R": "ComfyMathExpression", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "floor(a/32)*32" ] }, { "id": 221, "type": "PreviewAny", "pos": [ -2830, 5100 ], "size": [ 230, 160 ], "flags": { "collapsed": false }, "order": 19, "mode": 0, "inputs": [ { "name": "source", "type": "*", "link": 326 } ], "outputs": [ { "name": "STRING", "type": "STRING", "links": [ 327 ] } ], "properties": { "Node name for S&R": "PreviewAny", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ null, null, null ] }, { "id": 156, "type": "EmptyHiDreamO1LatentImage", "pos": [ -2030, 5420 ], "size": [ 280, 150 ], "flags": {}, "order": 6, "mode": 0, "inputs": [], "outputs": [ { "name": "LATENT", "type": "LATENT", "links": [ 233 ] } ], "properties": { "Node name for S&R": "EmptyHiDreamO1LatentImage", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ 2048, 2048, 1 ] }, { "id": 172, "type": "EmptyHiDreamO1LatentImage", "pos": [ -1410, 5700 ], "size": [ 280, 150 ], "flags": {}, "order": 20, "mode": 0, "inputs": [ { "name": "width", "type": "INT", "widget": { "name": "width" }, "link": 310 }, { "name": "height", "type": "INT", "widget": { "name": "height" }, "link": 311 } ], "outputs": [ { "name": "LATENT", "type": "LATENT", "links": [ 350 ] } ], "properties": { "Node name for S&R": "EmptyHiDreamO1LatentImage", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ 2048, 2048, 1 ] }, { "id": 226, "type": "MarkdownNote", "pos": [ -2540, 5430 ], "size": [ 360, 240 ], "flags": {}, "order": 7, "mode": 0, "inputs": [], "outputs": [], "title": "Note: Reference Images", "properties": {}, "widgets_values": [ "The HiDream O1 supports up to 10 reference images. You can add more Load Image nodes, then link them to the HiDream-O1 Reference Images node." ], "color": "#222", "bgcolor": "#000" }, { "id": 171, "type": "PrimitiveStringMultiline", "pos": [ -3440, 4890 ], "size": [ 310, 320 ], "flags": {}, "order": 8, "mode": 0, "inputs": [], "outputs": [ { "name": "STRING", "type": "STRING", "links": [ 260, 267 ] } ], "title": "User Prompt", "properties": { "Node name for S&R": "PrimitiveStringMultiline", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "Transform the background into a rainy neon city street at night, with wet asphalt reflections, blurred neon signs" ] }, { "id": 227, "type": "SaveImage", "pos": [ -1010, 4560 ], "size": [ 1260, 1330 ], "flags": {}, "order": 28, "mode": 0, "inputs": [ { "name": "images", "type": "IMAGE", "link": 347 } ], "outputs": [], "properties": { "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.1", "Node name for S&R": "SaveImage" }, "widgets_values": [ "hidream_o1" ] }, { "id": 205, "type": "MarkdownNote", "pos": [ -4330, 4560 ], "size": [ 820, 760 ], "flags": {}, "order": 9, "mode": 0, "inputs": [], "outputs": [], "properties": {}, "widgets_values": [ "Related PR: [#13817](https://github.com/Comfy-Org/ComfyUI/pull/13817)\n\n## Hidream O1 Tutorial\n[HidreamO1 tutorial](https://www.stablediffusiontutorials.com/2026/05/hidream-o1-image.html)\n\n## Model Links (for Local Users)\n\n**checkpoints**\n\n- [hidream_o1_image_dev_fp8_scaled.safetensors](https://huggingface.co/Comfy-Org/HiDream-O1-Image/resolve/main/checkpoints/hidream_o1_image_dev_fp8_scaled.safetensors)\n\n**text_encoders**\n\n- [gemma4_e4b_it_fp8_scaled.safetensors](https://huggingface.co/Comfy-Org/gemma-4/resolve/main/text_encoders/gemma4_e4b_it_fp8_scaled.safetensors)\n\n\n## Model Storage Location\n\n```\n📂 ComfyUI/\n├── 📂 models/\n│ ├── 📂 checkpoints/\n│ │ └── hidream_o1_image_dev_fp8_scaled.safetensors\n│ └── 📂 text_encoders/\n│ └── gemma4_e4b_it_fp8_scaled.safetensors\n```\n\n## Report Issue\n\nNote: Please install and update ComfyUI first ([guide](https://docs.comfy.org/installation/update_comfyui)) and prepare required models. Desktop/Cloud updates follow stable releases, so some nightly-supported models may not be available yet.\n\n- Cannot run / runtime errors: [ComfyUI/issues](https://github.com/comfyanonymous/ComfyUI/issues)\n- UI / frontend issues: [ComfyUI_frontend/issues](https://github.com/Comfy-Org/ComfyUI_frontend/issues)\n- Workflow issues: [workflow_templates/issues](https://github.com/Comfy-Org/workflow_templates/issues)\n" ], "color": "#222", "bgcolor": "#000" } ], "links": [ [ 139, 112, 0, 108, 4, "SIGMAS" ], [ 141, 110, 0, 104, 0, "CONDITIONING" ], [ 146, 6, 1, 110, 0, "CLIP" ], [ 147, 6, 2, 105, 1, "VAE" ], [ 182, 124, 0, 112, 0, "MODEL" ], [ 185, 125, 0, 108, 3, "SAMPLER" ], [ 192, 6, 0, 124, 0, "MODEL" ], [ 213, 124, 0, 108, 0, "MODEL" ], [ 217, 110, 0, 152, 0, "CONDITIONING" ], [ 218, 104, 0, 152, 1, "CONDITIONING" ], [ 220, 104, 1, 153, 1, "CONDITIONING" ], [ 224, 154, 0, 152, 2, "BOOLEAN" ], [ 225, 154, 0, 153, 2, "BOOLEAN" ], [ 233, 156, 0, 155, 0, "LATENT" ], [ 235, 154, 0, 155, 2, "BOOLEAN" ], [ 260, 171, 0, 175, 0, "STRING" ], [ 265, 177, 0, 176, 2, "BOOLEAN" ], [ 266, 175, 0, 176, 1, "STRING" ], [ 267, 171, 0, 176, 0, "STRING" ], [ 274, 6, 1, 188, 0, "CLIP" ], [ 275, 188, 0, 104, 1, "CONDITIONING" ], [ 276, 188, 0, 153, 0, "CONDITIONING" ], [ 300, 213, 0, 104, 2, "IMAGE" ], [ 301, 213, 0, 175, 1, "IMAGE" ], [ 302, 213, 0, 196, 0, "IMAGE" ], [ 310, 218, 1, 172, 0, "INT" ], [ 311, 219, 1, 172, 1, "INT" ], [ 318, 196, 0, 157, 0, "IMAGE" ], [ 319, 157, 0, 218, 0, "INT" ], [ 320, 157, 1, 219, 0, "INT" ], [ 321, 155, 0, 108, 5, "LATENT" ], [ 322, 108, 0, 105, 0, "LATENT" ], [ 323, 152, 0, 108, 1, "CONDITIONING" ], [ 324, 153, 0, 108, 2, "CONDITIONING" ], [ 326, 176, 0, 221, 0, "STRING" ], [ 327, 221, 0, 110, 1, "STRING" ], [ 347, 105, 0, 227, 0, "IMAGE" ], [ 350, 172, 0, 155, 1, "LATENT" ] ], "groups": [ { "id": 2, "title": "Sampling", "bounding": [ -1730, 4530, 690, 720 ], "color": "#3f789e", "flags": {} }, { "id": 3, "title": "Prompt", "bounding": [ -2560, 4530, 450, 720 ], "color": "#3f789e", "flags": {} }, { "id": 4, "title": "Model", "bounding": [ -3450, 4530, 860, 260 ], "color": "#3f789e", "flags": {} }, { "id": 6, "title": "Image Size", "bounding": [ -2080, 5280, 1040, 620 ], "color": "#3f789e", "flags": {} }, { "id": 7, "title": "I2V or Image Edit Switch", "bounding": [ -2080, 4530, 320, 460 ], "color": "#3f789e", "flags": {} }, { "id": 8, "title": "Image Input for Image Edit", "bounding": [ -3080, 5280, 970, 620 ], "color": "#3f789e", "flags": {} }, { "id": 9, "title": "Prompt Enhancement", "bounding": [ -3080, 4820, 490, 430 ], "color": "#3f789e", "flags": {} }, { "id": 10, "title": "Feature Switch", "bounding": [ -3450, 5280, 340, 620 ], "color": "#A88", "flags": {} }, { "id": 11, "title": "User Prompt", "bounding": [ -3450, 4820, 340, 430 ], "color": "#A88", "flags": {} }, { "id": 12, "title": "Size: Image Edit", "bounding": [ -2040, 5630, 920, 242.65625 ], "color": "#3f789e", "flags": {} }, { "id": 13, "title": "Size: Text to Image", "bounding": [ -2040, 5350, 300, 230 ], "color": "#3f789e", "flags": {} }, { "id": 14, "title": "Group", "bounding": [ -2080, 5000, 320, 250 ], "color": "#3f789e", "flags": {} } ], "definitions": { "subgraphs": [ { "id": "fa7296b5-c974-4466-bfe3-a1f05f43b880", "version": 1, "state": { "lastGroupId": 14, "lastNodeId": 228, "lastLinkId": 350, "lastRerouteId": 0 }, "revision": 0, "config": {}, "name": "Prompt Enhancement", "inputNode": { "id": -10, "bounding": [ -4280, 5580, 128, 108 ] }, "outputNode": { "id": -20, "bounding": [ -130, 5680, 128, 68 ] }, "inputs": [ { "id": "8e257a84-6ce5-4e50-b571-2118cc7a0b8f", "name": "replace", "type": "STRING", "linkIds": [ 248 ], "localized_name": "replace", "label": "user_prompt", "pos": [ -4176, 5604 ] }, { "id": "eae67611-94a9-4fb3-abd7-a29bc95db936", "name": "clip_name", "type": "COMBO", "linkIds": [ 263 ], "pos": [ -4176, 5624 ] }, { "id": "46f381cb-503d-4a53-b419-f510752553e6", "name": "image", "type": "IMAGE", "linkIds": [ 269 ], "pos": [ -4176, 5644 ] } ], "outputs": [ { "id": "54294308-5a73-4d61-a8dd-ff5b58aa91e8", "name": "output", "type": "STRING", "linkIds": [ 292 ], "localized_name": "output", "pos": [ -106, 5704 ] } ], "widgets": [], "nodes": [ { "id": 165, "type": "PrimitiveStringMultiline", "pos": [ -3930, 5440 ], "size": [ 510, 440 ], "flags": { "collapsed": false }, "order": 0, "mode": 0, "inputs": [], "outputs": [ { "localized_name": "STRING", "name": "STRING", "type": "STRING", "links": [ 243 ] } ], "title": "REWRITE_SYSTEM_PROMPT", "properties": { "Node name for S&R": "PrimitiveStringMultiline", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "<|turn>system\n你是专业的AI图像生成Prompt工程师的Prompt Engineering Engine,也是一名拥有百科知识和视觉导演能力的创意总监.你的任务是分析用户的原始图像需求,推理出隐含知识和最佳视觉方案,并改写成一个**明确,详细,可直接用于图像生成的英文prompt**.\n\n## 核心目标\n\n图像生成模型只能执行直接的视觉描述,不能自行补全背景知识,逻辑关系或文字内容.因此,你必须提前完成知识解析,空间规划和视觉导演,把结果显式写入prompt中.\n\n使用 SCALIST 框架扩写每个画面:\n- **Subject**: 主体的身份,外观,颜色,材质,纹理,动作,表情,服饰.\n- **Composition**: 镜头景别,视角,主体位置,前景/中景/背景层次,留白和视觉焦点.\n- **Action**: 主体正在做什么,动作方向,姿态,互动关系.\n- **Location**: 场景地点,室内/室外,时代,天气,时间段,环境细节.\n- **Image style**: photorealistic, cinematic, oil painting, watercolor, anime, 3D render 等,并匹配合适的光线和色彩氛围.\n- **Specs**: 摄影/渲染参数,如 85mm lens, low-angle shot, shallow depth of field, soft diffused light, dramatic backlighting, matte texture, sharp focus.\n- **Text rendering**: 如果用户要求文字,必须把准确文字放在英文双引号中,并说明字体风格,颜色,大小,材质和精确位置.\n\n1. **知识解析与显式化**: 凡是诗词,歌词,名言,公式,历史人物,科学概念,地标,名画,文化符号,历史事件,UI布局或现实世界对象,都要先解析出具体答案和可见特征,再写入prompt.不要只写 \"Mona Lisa\",\"Dunkirk evacuation\",\"freedom\" 这类需要模型自行理解的词.\n2. **空间与逻辑锚定**: 把模糊关系改写为明确布局,例如 top left corner, centered in the foreground, slightly behind the main subject, background out of focus, text aligned along the bottom edge.不要使用\"旁边\"\"一些\"\"好看\"等含糊表达.\n3. **文字排版精度**: 中文,英文,公式,多语言文本都必须逐字保留在引号中,例如 \"床前明月光,疑是地上霜.举头望明月,低头思故乡.\" 或 \"E = mc²\";同时指定字体(calligraphy, serif, sans-serif, handwritten),颜色,材质和位置.\n4. **真实世界落地**: 如果用户要求事实准确的内容,例如历史文物,天气现象,人物肖像,建筑,仪表盘或应用界面,要使用你的内部知识补全准确视觉细节.\n5. **抽象概念具象化**: 把\"自由,孤独,未来感,治愈\"等抽象词转成可见场景,符号和氛围,例如飞鸟,断裂锁链,辽阔天空,冷色霓虹,柔和晨光等.\n\n## 示例与学习\n\n- 用户说\"李白的静夜思写在墙上\",prompt 应写出完整中文诗句,并指定它以优雅中国书法写在古旧石墙的哪个位置.\n- 用户说\"三大力学的奠基人\"或\"爱因斯坦写质能方程\",prompt 应解析出 Isaac Newton 或 Albert Einstein,并描述人物外貌,时代服饰,黑板,公式 \"E = mc²\" 等可见内容.\n- 用户说\"蒙娜丽莎\"\"比萨斜塔\"\"福字\"\"敦刻尔克大撤退\",prompt 应描述对应画面特征: 神秘微笑与交叠双手,倾斜白色大理石钟楼与拱廊,红底金色/黑色书法 \"福\",1940年海滩上等待撤离的士兵和海面船只.\n\n## 输出prompt要求\n\n- prompt 必须是一个英文的,连贯自然的单段落,像 Creative Director's Brief,而不是关键词堆砌或 tag soup.\n- 长度通常为 80-220 词;简单需求可以更短,复杂画面可以更长.\n- 最重要的主体和画面意图放在开头,然后自然展开构图,动作,地点,风格,技术参数和文字渲染.\n- 使用完整句子,丰富但准确的形容词,摄影/绘画/设计术语.\n- 不要包含任何需要图像模型继续推理才能理解的表达.\n- prompt 必须自包含,仅凭prompt本身就能准确生成图片.\n\n## 执行步骤\n\n1. **Analyze**: 识别核心主体,用户意图,文字要求,参考限制和需要解析的隐含知识.\n2. **Reason**: 选择最适宜画面的光线,镜头,角度,纹理,风格,空间布局和事实细节.\n3. **Rewrite**: 输出最终增强后的英文单段落prompt.\n\n只输出JSON,不加任何其他文字:\n{\"prompt\": \"英文单段落prompt\", \"reasoning\": \"你的推理和知识解析过程(需要用用户输入的提示词语言来生成)\", \"resolved_knowledge\": \"你解析了哪些隐含知识(根据输入用户语言简述,如果没有隐含知识用对应语言写'无')\"} \n<|turn|>" ] }, { "id": 170, "type": "StringReplace", "pos": [ -3930, 5930 ], "size": [ 510, 260 ], "flags": { "collapsed": false }, "order": 4, "mode": 0, "inputs": [ { "localized_name": "replace", "name": "replace", "type": "STRING", "widget": { "name": "replace" }, "link": 248 } ], "outputs": [ { "localized_name": "STRING", "name": "STRING", "type": "STRING", "links": [ 244 ] } ], "properties": { "Node name for S&R": "StringReplace", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "<|turn>user\n{user_prompt}<|turn|>\n<|turn>model\n", "{user_prompt}", "" ] }, { "id": 166, "type": "StringConcatenate", "pos": [ -3350, 5440 ], "size": [ 230, 220 ], "flags": { "collapsed": false }, "order": 2, "mode": 0, "inputs": [ { "localized_name": "string_a", "name": "string_a", "type": "STRING", "widget": { "name": "string_a" }, "link": 243 }, { "localized_name": "string_b", "name": "string_b", "type": "STRING", "widget": { "name": "string_b" }, "link": 244 } ], "outputs": [ { "localized_name": "STRING", "name": "STRING", "type": "STRING", "links": [ 251 ] } ], "properties": { "Node name for S&R": "StringConcatenate", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "", "", "" ] }, { "id": 164, "type": "TextGenerate", "pos": [ -3070, 5220 ], "size": [ 400, 412 ], "flags": {}, "order": 1, "mode": 0, "showAdvanced": true, "inputs": [ { "localized_name": "clip", "name": "clip", "type": "CLIP", "link": 241 }, { "localized_name": "image", "name": "image", "shape": 7, "type": "IMAGE", "link": 269 }, { "localized_name": "video", "name": "video", "shape": 7, "type": "IMAGE", "link": null }, { "localized_name": "audio", "name": "audio", "shape": 7, "type": "AUDIO", "link": null }, { "localized_name": "prompt", "name": "prompt", "type": "STRING", "widget": { "name": "prompt" }, "link": 251 } ], "outputs": [ { "localized_name": "generated_text", "name": "generated_text", "type": "STRING", "links": [ 281 ] } ], "properties": { "Node name for S&R": "TextGenerate", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "", 2048, "on", 0.7, 64, 0.95, 0.05, 1.05, 0, 0, false, false ] }, { "id": 167, "type": "CLIPLoader", "pos": [ -3930, 5220 ], "size": [ 510, 160 ], "flags": {}, "order": 3, "mode": 0, "inputs": [ { "localized_name": "clip_name", "name": "clip_name", "type": "COMBO", "widget": { "name": "clip_name" }, "link": 263 } ], "outputs": [ { "localized_name": "CLIP", "name": "CLIP", "type": "CLIP", "links": [ 241 ] } ], "properties": { "Node name for S&R": "CLIPLoader", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0", "models": [ { "name": "gemma4_e4b_it_fp8_scaled.safetensors", "url": "https://huggingface.co/Comfy-Org/gemma-4/resolve/main/text_encoders/gemma4_e4b_it_fp8_scaled.safetensors", "directory": "text_encoders" } ] }, "widgets_values": [ "gemma4_e4b_it_fp8_scaled.safetensors", "stable_diffusion", "default" ] }, { "id": 198, "type": "JsonExtractString", "pos": [ -1360, 5710 ], "size": [ 400, 200 ], "flags": {}, "order": 5, "mode": 0, "inputs": [ { "localized_name": "json_string", "name": "json_string", "type": "STRING", "widget": { "name": "json_string" }, "link": 288 } ], "outputs": [ { "localized_name": "STRING", "name": "STRING", "type": "STRING", "links": [ 291, 292 ] } ], "properties": { "Node name for S&R": "JsonExtractString", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "", "prompt" ] }, { "id": 199, "type": "PreviewAny", "pos": [ -2590, 5220 ], "size": [ 460, 980 ], "flags": {}, "order": 6, "mode": 4, "inputs": [ { "localized_name": "source", "name": "source", "type": "*", "link": 281 } ], "outputs": [ { "localized_name": "STRING", "name": "STRING", "type": "STRING", "links": [ 285 ] } ], "properties": { "Node name for S&R": "PreviewAny", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ null, null, null ] }, { "id": 200, "type": "PreviewAny", "pos": [ -1640, 5240 ], "size": [ 250, 220 ], "flags": {}, "order": 7, "mode": 4, "inputs": [ { "localized_name": "source", "name": "source", "type": "*", "link": 286 } ], "outputs": [ { "localized_name": "STRING", "name": "STRING", "type": "STRING", "links": [] } ], "properties": { "Node name for S&R": "PreviewAny", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ null, null, null ] }, { "id": 201, "type": "RegexReplace", "pos": [ -2080, 5230 ], "size": [ 400, 400 ], "flags": {}, "order": 8, "mode": 0, "showAdvanced": true, "inputs": [ { "localized_name": "string", "name": "string", "type": "STRING", "widget": { "name": "string" }, "link": 285 } ], "outputs": [ { "localized_name": "STRING", "name": "STRING", "type": "STRING", "links": [ 286, 287 ] } ], "properties": { "Node name for S&R": "RegexReplace", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "", "^```(?:json)?\\s*\\n?", "", false, false, false, 1 ] }, { "id": 202, "type": "RegexReplace", "pos": [ -2080, 5710 ], "size": [ 400, 400 ], "flags": {}, "order": 9, "mode": 0, "showAdvanced": false, "inputs": [ { "localized_name": "string", "name": "string", "type": "STRING", "widget": { "name": "string" }, "link": 287 } ], "outputs": [ { "localized_name": "STRING", "name": "STRING", "type": "STRING", "links": [ 288, 290 ] } ], "properties": { "Node name for S&R": "RegexReplace", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ "", "\\n?```\\s*$", "", false, false, false, 1 ] }, { "id": 203, "type": "PreviewAny", "pos": [ -1630, 5710 ], "size": [ 230, 170 ], "flags": {}, "order": 10, "mode": 4, "inputs": [ { "localized_name": "source", "name": "source", "type": "*", "link": 290 } ], "outputs": [ { "localized_name": "STRING", "name": "STRING", "type": "STRING", "links": [] } ], "properties": { "Node name for S&R": "PreviewAny", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ null, null, null ] }, { "id": 204, "type": "PreviewAny", "pos": [ -900, 5710 ], "size": [ 300, 400 ], "flags": {}, "order": 11, "mode": 4, "inputs": [ { "localized_name": "source", "name": "source", "type": "*", "link": 291 } ], "outputs": [ { "localized_name": "STRING", "name": "STRING", "type": "STRING", "links": [] } ], "properties": { "Node name for S&R": "PreviewAny", "enableTabs": false, "tabWidth": 65, "tabXOffset": 10, "hasSecondTab": false, "secondTabText": "Send Back", "secondTabOffset": 80, "secondTabWidth": 65, "cnr_id": "comfy-core", "ver": "0.21.0" }, "widgets_values": [ null, null, null ] } ], "groups": [ { "id": 5, "title": "Prompt Enhancement", "bounding": [ -3960, 5130, 1350, 1070 ], "color": "#3f789e", "flags": {} } ], "links": [ { "id": 243, "origin_id": 165, "origin_slot": 0, "target_id": 166, "target_slot": 0, "type": "STRING" }, { "id": 244, "origin_id": 170, "origin_slot": 0, "target_id": 166, "target_slot": 1, "type": "STRING" }, { "id": 241, "origin_id": 167, "origin_slot": 0, "target_id": 164, "target_slot": 0, "type": "CLIP" }, { "id": 251, "origin_id": 166, "origin_slot": 0, "target_id": 164, "target_slot": 4, "type": "STRING" }, { "id": 248, "origin_id": -10, "origin_slot": 0, "target_id": 170, "target_slot": 0, "type": "STRING" }, { "id": 263, "origin_id": -10, "origin_slot": 1, "target_id": 167, "target_slot": 0, "type": "COMBO" }, { "id": 269, "origin_id": -10, "origin_slot": 2, "target_id": 164, "target_slot": 1, "type": "IMAGE" }, { "id": 281, "origin_id": 164, "origin_slot": 0, "target_id": 199, "target_slot": 0, "type": "STRING" }, { "id": 285, "origin_id": 199, "origin_slot": 0, "target_id": 201, "target_slot": 0, "type": "STRING" }, { "id": 286, "origin_id": 201, "origin_slot": 0, "target_id": 200, "target_slot": 0, "type": "STRING" }, { "id": 287, "origin_id": 201, "origin_slot": 0, "target_id": 202, "target_slot": 0, "type": "STRING" }, { "id": 288, "origin_id": 202, "origin_slot": 0, "target_id": 198, "target_slot": 0, "type": "STRING" }, { "id": 290, "origin_id": 202, "origin_slot": 0, "target_id": 203, "target_slot": 0, "type": "STRING" }, { "id": 291, "origin_id": 198, "origin_slot": 0, "target_id": 204, "target_slot": 0, "type": "STRING" }, { "id": 292, "origin_id": 198, "origin_slot": 0, "target_id": -20, "target_slot": 0, "type": "STRING" } ], "extra": {} } ] }, "config": {}, "extra": { "ds": { "scale": 0.7655036171045577, "offset": [ 4594.019740543663, -4363.432867073958 ] }, "frontendVersion": "1.43.16", "linearData": { "inputs": [], "outputs": [] }, "VHS_latentpreview": false, "VHS_latentpreviewrate": 0, "VHS_MetadataImage": true, "VHS_KeepIntermediate": true }, "version": 0.4 }