Files
fblissjr-ComfyUI-QwenImageW…/example_workflows/2_qwen_image_edit.json
T
Fred Bliss 4a091e9298 Fix coordinate handling and make object_ref optional
- Fixed generateTokens to properly handle different region types (bounding_box, polygon, object_reference)
- Added checkbox UI to control includeObjectRef for boxes/polygons
- Object references now correctly handle 2 coordinates instead of expecting 4
- Updated Python code to respect includeObjectRef flag from JavaScript
- Fixed coordinate format issues (x1,y1,x2,y2 for boxes, x,y pairs for polygons)
- Restored updateBasePromptWithTokens function for editable prompts
- Default behavior keeps object_ref (checkbox checked) for backward compatibility
- Without object_ref, generates pure spatial tokens like <|box_start|>0.1,0.2,0.3,0.4<|box_end|>
2025-09-06 09:33:32 -05:00

147 lines
3.8 KiB
JSON

{
"last_node_id": 12,
"last_link_id": 18,
"nodes": [
{
"id": 1,
"type": "CheckpointLoaderSimple",
"pos": [50, 200],
"size": {"0": 315, "1": 98},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{"name": "MODEL", "type": "MODEL", "links": [1]},
{"name": "CLIP", "type": "CLIP", "links": [2]},
{"name": "VAE", "type": "VAE", "links": [3, 10]}
],
"properties": {"Node name for S&R": "CheckpointLoaderSimple"},
"widgets_values": ["qwen-image-edit.safetensors"]
},
{
"id": 2,
"type": "LoadImage",
"pos": [50, 350],
"size": {"0": 315, "1": 314},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{"name": "IMAGE", "type": "IMAGE", "links": [11]},
{"name": "MASK", "type": "MASK", "links": null}
],
"properties": {"Node name for S&R": "LoadImage"},
"widgets_values": ["input_image.png", "image"]
},
{
"id": 3,
"type": "QwenImageEditTextEncoder",
"pos": [400, 200],
"size": {"0": 400, "1": 400},
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{"name": "clip", "type": "CLIP", "link": 2},
{"name": "vae", "type": "VAE", "link": 3},
{"name": "edit_image", "type": "IMAGE", "link": 11}
],
"outputs": [
{"name": "conditioning", "type": "CONDITIONING", "links": [4]},
{"name": "edit_latent", "type": "LATENT", "links": [5]},
{"name": "encode_info", "type": "DICT", "links": [6]}
],
"properties": {"Node name for S&R": "QwenImageEditTextEncoder"},
"widgets_values": [
"Change the time of day to night, add stars in the sky, make the lighting moonlit",
"image_edit",
true,
1048576,
true,
false,
"",
""
]
},
{
"id": 4,
"type": "QwenImageSamplerWrapper",
"pos": [850, 200],
"size": {"0": 315, "1": 350},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{"name": "model", "type": "MODEL", "link": 1},
{"name": "conditioning", "type": "CONDITIONING", "link": 4},
{"name": "edit_latent", "type": "LATENT", "link": 5}
],
"outputs": [
{"name": "LATENT", "type": "LATENT", "links": [8]}
],
"properties": {"Node name for S&R": "QwenImageSamplerWrapper"},
"widgets_values": [
42,
30,
4.0,
"euler",
"normal",
0.5,
"default",
1.0
]
},
{
"id": 5,
"type": "VAEDecode",
"pos": [1200, 200],
"size": {"0": 210, "1": 46},
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{"name": "samples", "type": "LATENT", "link": 8},
{"name": "vae", "type": "VAE", "link": 10}
],
"outputs": [
{"name": "IMAGE", "type": "IMAGE", "links": [9]}
],
"properties": {"Node name for S&R": "VAEDecode"}
},
{
"id": 6,
"type": "SaveImage",
"pos": [1450, 200],
"size": {"0": 315, "1": 270},
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{"name": "images", "type": "IMAGE", "link": 9}
],
"properties": {"Node name for S&R": "SaveImage"},
"widgets_values": ["qwen_edited"]
}
],
"links": [
[1, 1, 0, 4, 0, "MODEL"],
[2, 1, 1, 3, 0, "CLIP"],
[3, 1, 2, 3, 1, "VAE"],
[4, 3, 0, 4, 1, "CONDITIONING"],
[5, 3, 1, 4, 2, "LATENT"],
[8, 4, 0, 5, 0, "LATENT"],
[9, 5, 0, 6, 0, "IMAGE"],
[10, 1, 2, 5, 1, "VAE"],
[11, 2, 0, 3, 2, "IMAGE"]
],
"groups": [
{
"title": "Image Editing with Vision Tokens",
"bounding": [30, 120, 1750, 560],
"color": "#3f789e"
}
],
"config": {},
"extra": {},
"version": 0.4
}