SenseNova U1.6:图像编辑
用 SenseNova-U1.6 编辑照片:把原图作为参考附件、用一句话描述要改的地方,同一个 8B 多模态主干先读懂原图再改写,按原图分辨率返回结果,交付前还会自校正一遍、对照提示词复查。
简介
Edit a photo with SenseNova-U1.6 by attaching it as a reference and describing the change; the same 8B multimodal backbone reads the source, reworks it and returns the edit at the source's own resolution, with a self-correction pass that re-checks the result against the prompt before returning it.
Graph: CLIPLoader, CLIPTextEncode, CheckpointLoaderSimple, ComfyMathExpression, ComfySwitchNode, CreateList, EmptyHiDreamO1LatentImage, EndLoop, GetImageSize, GetItemFromList, HiDreamO1ReferenceImages, ImageCompare, KSampler, LoadImage, LoraLoaderModelOnly, MarkdownNote, PreviewAny, PrimitiveBoolean, PrimitiveFloat, PrimitiveInt, PrimitiveStringMultiline, ResizeImageMaskNode, SaveImage, SenseNovaConditioning, SenseNovaInterleaveDecode, StartLoop, TextGenerateV2, VAEDecode. Output: image (image_sensenova_u16_image_edit.png).
你需要提供
- 正在读取工作流
在 ComfyUI 中运行。 此工作流无法在本页面运行。请下载后在 ComfyUI 中打开。
下载工作流查看工作流内部
节点图的只读预览。在 Comfy Cloud 中打开或下载后即可编辑节点。
Loading the graph
Open full-size workflow preview此工作流中的文件
- 输出
- 图像
- 作者
- 作者信息暂不可用
需要自定义节点
- 正在读取工作流
通过代码使用此工作流
尽可能根据工作流图和输入自动生成代码,否则显示已保存的示例。运行代码可能产生费用,请先核对凭据和端点。
What you need
- Runs on
- Comfy Cloud
- 密钥
- COMFY_API_KEY
需要付费的 Cloud 方案和额度。
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"1": {
"class_type": "CheckpointLoaderSimple",
"inputs": {
"ckpt_name": "sensenova_u1.6_8b_mot_int8_convrot.safetensors"
},
"_meta": {
"title": "Load Checkpoint"
}
},
"4": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"1",
1
],
"text": [
"54",
0
]
},
"_meta": {
"title": "CLIP Text Encode (Positive)"
}
},
"5": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"1",
1
],
"text": ""
},
"_meta": {
"title": "CLIP Text Encode (Negative)"
}
},
"6": {
"class_type": "EmptyHiDreamO1LatentImage",
"inputs": {
"batch_size": 1,
"height": [
"82",
1
],
"width": [
"82",
0
]
},
"_meta": {
"title": "Empty HiDream-O1 Latent Image"
}
},
"7": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 944861539896026
},
"_meta": {
"title": "Int (Seed)"
}
},
"9": {
"class_type": "StartLoop",
"inputs": {
"cache_iterations": False,
"initial_iteration_value": [
"44",
0
],
"mode": "simple",
"mode.num_iterations": 5
},
"_meta": {
"title": "Start Loop"
}
},
"10": {
"class_type": "GetItemFromList",
"inputs": {
"index": 0,
"list": [
"9",
4
]
},
"_meta": {
"title": "Get Item From List (Positive)"
}
},
"11": {
"class_type": "GetItemFromList",
"inputs": {
"index": 1,
"list": [
"9",
4
]
},
"_meta": {
"title": "Get Item From List (Negative)"
}
},
"12": {
"class_type": "GetItemFromList",
"inputs": {
"index": 2,
"list": [
"9",
4
]
},
"_meta": {
"title": "Get Item From List (Previous latent)"
}
},
"14": {
"class_type": "SenseNovaConditioning",
"inputs": {
"clip": [
"1",
1
],
"conditioning": [
"10",
0
],
"max_tokens": 1024,
"negative": [
"11",
0
],
"task": "self-correction",
"task.samples": [
"48",
0
]
},
"_meta": {
"title": "SenseNova Conditioning"
}
},
"15": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "a + b",
"values.a": [
"9",
0
],
"values.b": [
"7",
0
]
},
"_meta": {
"title": "Seed per iteration"
}
},
"16": {
"class_type": "KSampler",
"inputs": {
"cfg": [
"40",
0
],
"denoise": 1,
"latent_image": [
"6",
0
],
"model": [
"41",
0
],
"negative": [
"14",
2
],
"positive": [
"14",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": [
"15",
1
],
"steps": [
"47",
0
]
},
"_meta": {
"title": "KSampler"
}
},
"20": {
"class_type": "EndLoop",
"inputs": {
"accumulate": False,
"next_iteration_value": [
"46",
0
],
"output_value": [
"46",
0
],
"terminations.termination0": [
"14",
1
]
},
"_meta": {
"title": "End Loop"
}
},
"21": {
"class_type": "GetItemFromList",
"inputs": {
"index": 0,
"list": [
"20",
0
]
},
"_meta": {
"title": "Final conditioning"
}
},
"22": {
"class_type": "GetItemFromList",
"inputs": {
"index": 2,
"list": [
"20",
0
]
},
"_meta": {
"title": "Final latent"
}
},
"23": {
"class_type": "SenseNovaInterleaveDecode",
"inputs": {
"clip": [
"1",
1
],
"conditioning": [
"21",
0
],
"samples": [
"22",
0
]
},
"_meta": {
"title": "SenseNova Interleave Decode"
}
},
"24": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "image_sensenova_u16_image_edit",
"images": [
"74",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"27": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "sensenova_u1.6_8b_mot_8step_lora_bf16.safetensors",
"model": [
"1",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"29": {
"class_type": "HiDreamO1ReferenceImages",
"inputs": {
"images.image_1": [
"81",
0
],
"negative": [
"5",
0
],
"positive": [
"4",
0
]
},
"_meta": {
"title": "HiDream-O1 Reference Images"
}
},
"34": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": False
},
"_meta": {
"title": "Turbo Mode?"
}
},
"35": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 8
},
"_meta": {
"title": "Int (Steps)"
}
},
"36": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 50
},
"_meta": {
"title": "Int (Setps)"
}
},
"37": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 4
},
"_meta": {
"title": "Float (CFG)"
}
},
"38": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 1
},
"_meta": {
"title": "Float (CFG)"
}
},
"40": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"37",
0
],
"on_true": [
"38",
0
],
"switch": [
"34",
0
]
},
"_meta": {
"title": "If/Else Switch (cfg)"
}
},
"41": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"1",
0
],
"on_true": [
"27",
0
],
"switch": [
"34",
0
]
},
"_meta": {
"title": "If/Else Switch (Model)"
}
},
"44": {
"class_type": "CreateList",
"inputs": {
"inputs.input0": [
"29",
0
],
"inputs.input1": [
"29",
1
]
},
"_meta": {
"title": "Create List"
}
},
"45": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_true": [
"16",
0
],
"switch": [
"14",
3
]
},
"_meta": {
"title": "If/Else Switch"
}
},
"46": {
"class_type": "CreateList",
"inputs": {
"inputs.input0": [
"14",
0
],
"inputs.input1": [
"14",
2
],
"inputs.input2": [
"45",
0
]
},
"_meta": {
"title": "Create List"
}
},
"47": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"36",
0
],
"on_true": [
"35",
0
],
"switch": [
"34",
0
]
},
"_meta": {
"title": "If/Else Switch (steps)"
}
},
"48": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"12",
0
],
"switch": [
"9",
1
]
},
"_meta": {
"title": "If/Else Switch (Previous latent)"
}
},
"53": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "# Image Editing and Reference-Guided Prompt Enhancer\n\nRewrite the user's image request into one directly executable prompt for an image model. Use the original request and the images actually supplied. Preserve the user's explicit requirements, including the scope and degree of the change, named subjects, counts, colors, positions, and exact on-image text.\n\n## Interpret the request and inspect the images\n\nDetermine whether the user wants to edit an existing image, assemble a new composition from references, or generate a new image. Inspect the supplied images in input order. Identify the base image when applicable and determine what each relevant reference contributes, such as identity, product appearance, pose, layout, palette, or style. Use image numbers only for images actually supplied.\n\nCarry relevant visible details from the supplied images into the final prompt. For a local edit, identify the target by its appearance, position, or relationship to a nearby object. Name the surrounding details that need to be preserved for the edit to fit the scene. For a multi-reference composition, identify which image supplies each transferred subject, object, or style, and describe the visible features that should carry over. Include only details that help the image model locate, preserve, or reproduce the requested content. Leave unclear source details unspecified. For a new composition, make reasonable choices where the user has left them open.\n\n## Write the visual requirements\n\nFor a local edit, lead with the action. State what to change, where it is, and what the result should look like. Identify the relevant details to preserve, such as subject identity, object shape, position, framing, lighting, background, or nearby content. Keep the scope narrow when the user asks for a narrow change.\n\nFor a new composition or a broad redesign, open with the intended medium, main subject, and overall visual treatment. Describe the finished image in a natural visual order. For a poster, infographic, or other design with distinct regions, cover the background, top, main content, and bottom as applicable. For a single-subject image, organize the description around the subject and its relationship to the surroundings. Use specific positions and relative sizes when they help place an element.\n\nFor multi-image compositions, preserve each reference subject's distinguishing features and adapt viewpoint, scale, lighting, contact shadows, reflections, and occlusion to the shared scene. When the edit affects people, describe the requirements that apply to their visible body parts, including proportions, joints, pose, weight-bearing, hands, and physical contact. Keep each person's identity distinct in group compositions.\n\nFor style or layout transfer, specify the visible qualities to carry over, such as composition, spacing, shapes, palette, texture, materials, or lighting. For designed artifacts, define the focal hierarchy, alignment, spacing, and relative scale of the main regions. Where lighting or material affects the requested result, describe its visible effect on the relevant object or surface. Coordinate saturation across the image while honoring the user's requested color intensity.\n\n## Handle visible text\n\nWhen the finished image needs visible text, include the text requirements in the same output paragraph. For each relevant text element, specify its exact copy, location, hierarchy, and the legibility constraints that matter, such as relative size, alignment, contrast, or separation from nearby graphics. Put literal copy in straight double quotes. Preserve its original language, script, spelling, capitalization, punctuation, spacing, numbers, units, and symbols.\n\nFor text replacement or correction, give the exact old and new strings and identify their location. When editing an existing design, preserve readable text outside the requested change. If text that must be preserved is unreadable, identify its region and instruct the image model to keep it unchanged. For charts and tables, preserve the relevant data, axis titles, tick labels, legend entries, units, and cell values. Use the request and supplied images as the sources for exact values.\n\nFor a new text-bearing design, such as a poster, cover, or infographic, supply concise, task-specific copy when the user has left it open. Infer the language of newly written copy from the request or target artifact. Keep optional copy sparse and readable. Do not invent unsupported prices, dates, statistics, claims, or brands. When no visible text is needed, omit text instructions.\n\n## Examples\n\nUser: Change the mug on the left to matte navy blue.\nImage context: An ivory mug with a curved handle sits beside an open notebook on a wooden desk in soft window light.\nOutput: Change the ivory mug to the left of the open notebook to matte navy blue. Keep its curved handle, size, and position on the wooden desk. Preserve the soft window light, the contact shadow beneath the mug, and the surrounding scene.\n\nUser: 把图表标题从“第二季度营收”改成“第三季度营收”,数据别动。\nOutput: Replace \"第二季度营收\" with \"第三季度营收\" in the existing chart title area. Match the original title's alignment, relative size, and contrast. Preserve the chart data, axis labels, tick labels, units, and legend exactly as shown.\n\nUser: Use the person in image 1 and the bag in image 2 to make a street-style photo.\nImage context: Image 1 shows a person with a short, straight bob. Image 2 shows a structured tan leather bag with a short top handle and brass hardware.\nOutput: An eye-level street-style photograph shows the person from image 1 carrying the structured tan leather bag from image 2. Preserve the person's facial identity and short, straight bob, and retain the bag's shape, short top handle, and brass hardware. The bag hangs at a natural angle from the person's hand. Soft daylight falls consistently across the person and bag, with subtle contact shadows where the fingers wrap around the handle.\n\nUser: Make a simple coffee tasting poster with the title 周末咖啡品鉴.\nOutput: A vertical coffee tasting poster uses a warm cream background and muted coffee-brown accents. The title \"周末咖啡品鉴\" spans the upper third in large, dark lettering with clear contrast. A photograph of a ceramic cup and scattered coffee beans anchors the lower half, with generous open space between the title and the photograph.\n\n## Output format\n\nReturn only the final image prompt as one continuous line of plain English text, with no line breaks. Keep literal on-image copy in its original language and script. Use direct edit instructions for changes and preservation, and present-tense descriptions for newly composed visual content. Match the level of detail to the task. Omit headings, labels, analysis, Markdown, JSON, placeholders, aspect-ratio fields, resolution, and pixel counts."
},
"_meta": {
"title": "Text (System Prompt - Image Editing and Reference-Guided )"
}
},
"54": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"61",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"55": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen3.5_9b_qwen_image_2.1_pe_i2i.int8_convrot.safetensors",
"device": "default",
"type": "stable_diffusion"
},
"_meta": {
"title": "Load CLIP"
}
},
"57": {
"class_type": "TextGenerateV2",
"inputs": {
"clip": [
"55",
0
],
"images.image1": [
"81",
0
],
"max_length": 8192,
"mtp": "auto",
"prompt": [
"64",
0
],
"sampling_mode": "on",
"sampling_mode.min_p": 0,
"sampling_mode.presence_penalty": 1.5,
"sampling_mode.repetition_penalty": 1,
"sampling_mode.seed": 0,
"sampling_mode.temperature": 1,
"sampling_mode.top_k": 20,
"sampling_mode.top_p": 0.95,
"system_prompt": [
"53",
0
],
"thinking": True,
"use_default_template": True
},
"_meta": {
"title": "Generate Text"
}
},
"60": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": True
},
"_meta": {
"title": "Boolean(Enable PE)"
}
},
"61": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"64",
0
],
"on_true": [
"57",
0
],
"switch": [
"60",
0
]
},
"_meta": {
"title": "If/Else Switch"
}
},
"64": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "Put sunglasses on the character, change the scene to a coastal highway, keep the character composition unchanged, and retain the car."
},
"_meta": {
"title": "Text (User Prompt)"
}
},
"67": {
"class_type": "KSampler",
"inputs": {
"cfg": [
"40",
0
],
"denoise": 1,
"latent_image": [
"6",
0
],
"model": [
"41",
0
],
"negative": [
"85",
2
],
"positive": [
"85",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 42,
"steps": [
"47",
0
]
},
"_meta": {
"title": "KSampler"
}
},
"69": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"67",
0
],
"vae": [
"1",
2
]
},
"_meta": {
"title": "VAE Decode"
}
},
"74": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"69",
0
],
"on_true": [
"23",
1
],
"switch": [
"75",
0
]
},
"_meta": {
"title": "If/Else Switch"
}
},
"75": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": True
},
"_meta": {
"title": "Boolean (Self-Correction)"
}
},
"79": {
"class_type": "LoadImage",
"inputs": {
"image": "sensenova_u16_edit_women_in_car.png"
},
"_meta": {
"title": "Load Image"
}
},
"80": {
"class_type": "ResizeImageMaskNode",
"inputs": {
"input": [
"79",
0
],
"resize_type": "scale total pixels",
"resize_type.megapixels": 4,
"scale_method": "area"
},
"_meta": {
"title": "Resize Image/Mask"
}
},
"81": {
"class_type": "ResizeImageMaskNode",
"inputs": {
"input": [
"80",
0
],
"resize_type": "scale to multiple",
"resize_type.multiple": 32,
"scale_method": "lanczos"
},
"_meta": {
"title": "Resize Image/Mask"
}
},
"82": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"81",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"83": {
"class_type": "ImageCompare",
"inputs": {
"compare_view": None,
"image_a": [
"81",
0
],
"image_b": [
"24",
0
]
},
"_meta": {
"title": "Compare Images"
}
},
"85": {
"class_type": "SenseNovaConditioning",
"inputs": {
"clip": [
"1",
1
],
"conditioning": [
"29",
0
],
"max_tokens": 1024,
"negative": [
"29",
1
],
"task": "image"
},
"_meta": {
"title": "SenseNova Conditioning"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)