Files
scraed-LanPaint/example_workflows/Hunyuan_EncodeDecode_Inpaint.json
T
scraed 59aa08dff0 Store masks inside exported videos and convert the example set to ImageEncode/ImageDecode
Mask-in-video (the masks now travel with the video file):
- New videometa module: write/read a JSON payload under the lanpaint-mask
  mp4 metadata tag via PyAV (stream copy, movflags=use_metadata_tags), so
  exporting produces a NEW file and the source is never modified.
- Two server routes: GET /lanpaint/video_mask_meta (read the payload back)
  and POST /lanpaint/export_mask_video (remux into input/<base>_masked.mp4).
- The mask editor exports the painted keyframes (base64 PNGs) + audio
  intervals into the video; loading a video with the tag auto-restores the
  masks (editor and node preview). A video without the tag clears the
  workflow's masks - the video is the source of truth. The export also
  offers a native save dialog (showSaveFilePicker) when available.
- The video widget upload now uses video_upload so MP4s are selectable in
  the file chooser (was image_upload).
- LanPaint_ImageEncode accepts 5D latents from video VAEs encoding a single
  image (e.g. the Hunyuan video VAE) - fixes the Hunyuan example.

Example set conversion (one example per supported model, new files, old
pairs removed after being superseded):
- New *ImageEncode/*EncodeDecode example workflows for SDXL, Flux.1,
  Flux.2 Dev, Flux2 Klein, SD3.5, Hunyuan, Ideogram4, Krea2, Qwen Edit,
  Qwen Image, Z-Image, Wan 2.2 and MiniMax H3 (AV), all using
  LanPaint_ImageEncode/ImageDecode instead of VAEEncode +
  SetLatentNoiseMask + VAEDecode + MaskBlend; every example references its
  own example folder's masked input (hash-verified); preview jpgs generated
  from the test runs; the H3 example ships its output mp4 as a preview.
- HiDream example removed on request; Example_29 added with the H3 masked
  input video.

Fixes along the way: normalize node input.link/output.links fields against
the links arrays in all converted workflows (the frontend renders
null-link nodes as disconnected); stale Inpainting_mode widget removed from
the Flux.2 sampler; Lambda defaults 5.0 (first-order scheme); torchaudio
resample test assertion relaxed (edge ringing); the videometa tests updated
to the final export signature.
2026-08-09 20:41:45 +08:00

999 lines
14 KiB
JSON

{
"id": "054799b4-76bf-4b4e-b7b7-615d2914285b",
"revision": 0,
"last_node_id": 119,
"last_link_id": 274,
"nodes": [
{
"id": 88,
"type": "Note",
"pos": [
180,
440
],
"size": [
350,
110
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [],
"properties": {
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.1",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"Select a fp8 weight_dtype if you are running out of memory."
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 103,
"type": "UNETLoader",
"pos": [
180,
310
],
"size": [
350,
82
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"slot_index": 0,
"links": [
250
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.23",
"Node name for S&R": "UNETLoader",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.1",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"hunyuan_video_t2v_720p_bf16.safetensors",
"default"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 94,
"type": "DualCLIPLoader",
"pos": [
-160,
-60
],
"size": [
350,
130
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "CLIP",
"type": "CLIP",
"slot_index": 0,
"links": [
252,
255
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.23",
"Node name for S&R": "DualCLIPLoader",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.1",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"clip_l.safetensors",
"llava_llama3_fp8_scaled.safetensors",
"hunyuan_video",
"default"
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 114,
"type": "FluxGuidance",
"pos": [
653.5101318359375,
-73.20354461669922
],
"size": [
270,
58
],
"flags": {},
"order": 11,
"mode": 0,
"inputs": [
{
"name": "conditioning",
"type": "CONDITIONING",
"link": 258
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
259
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.65",
"Node name for S&R": "FluxGuidance"
},
"widgets_values": [
6
]
},
{
"id": 105,
"type": "LoadImage",
"pos": [
171.56072998046875,
795.9495239257812
],
"size": [
274.080078125,
314
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
266,
272
]
},
{
"name": "MASK",
"type": "MASK",
"links": [
266,
272
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.59",
"Node name for S&R": "LoadImage",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.1",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"Masked_Load_Me_in_Loader (8).png",
"image"
]
},
{
"id": 104,
"type": "CLIPTextEncode",
"pos": [
226.1235809326172,
-161.8229522705078
],
"size": [
310,
240
],
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 252
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"slot_index": 0,
"links": [
258
]
}
],
"title": "CLIP Text Encode (Positive Prompt)",
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.23",
"Node name for S&R": "CLIPTextEncode",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.1",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"Close up Portrait of a futuristic cowgirl wearing jeans rides a mechanical horse across a vast cyberpunk desert. The dunes shimmer with holographic projections, glowing in blues and purples. cacti and two massive moons hang low on the horizon, illuminating the dusty air. Cyberpunk western fusion, cinematic, 8K, highly detailed, atmospheric perspective, Blade Runner style."
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 113,
"type": "CLIPTextEncode",
"pos": [
233.61778259277344,
122.75636291503906
],
"size": [
319.00726318359375,
88
],
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 255
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"slot_index": 0,
"links": [
254
]
}
],
"title": "CLIP Text Encode (Positive Prompt)",
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.23",
"Node name for S&R": "CLIPTextEncode",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.1",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
""
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 92,
"type": "Note",
"pos": [
1340,
250
],
"size": [
210,
170
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [],
"outputs": [],
"properties": {
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.1",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"Use the tiled decode node by default because most people will need it.\n\nLower the tile_size and overlap if you run out of memory."
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 116,
"type": "Note",
"pos": [
1324.0262451171875,
583.7811889648438
],
"size": [
210,
170
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [],
"outputs": [],
"properties": {
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.1",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"Decrease LanPaint_NumSteps to accelerate"
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 85,
"type": "VAEDecodeTiled",
"pos": [
1341.9100341796875,
49.04500961303711
],
"size": [
210,
150
],
"flags": {},
"order": 14,
"mode": 4,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 248
},
{
"name": "vae",
"type": "VAE",
"link": 237
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"slot_index": 0,
"links": [
251
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.18",
"Node name for S&R": "VAEDecodeTiled",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.1",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
256,
64,
64,
8
]
},
{
"id": 86,
"type": "SaveAnimatedWEBP",
"pos": [
1661.5201416015625,
68.0674819946289
],
"size": [
380,
366
],
"flags": {},
"order": 16,
"mode": 4,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 251
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.18",
"Node name for S&R": "SaveAnimatedWEBP",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.1",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"ComfyUI",
24,
false,
80,
"default"
]
},
{
"id": 110,
"type": "LanPaint_KSampler",
"pos": [
829.425537109375,
218.98995971679688
],
"size": [
400,
596
],
"flags": {},
"order": 13,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 239
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 259
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 254
},
{
"name": "latent_image",
"type": "LATENT",
"link": 269
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
248,
270
]
}
],
"properties": {
"cnr_id": "LanPaint",
"ver": "6109df6591a4cf2bc9d3b113d03f7297fa9248e9",
"Node name for S&R": "LanPaint_KSampler"
},
"widgets_values": [
534861079790570,
"randomize",
20,
1,
"euler",
"simple",
1,
5,
"Image First",
"LanPaint KSampler. For more info, visit https://github.com/scraed/LanPaint. If you find it useful, please give a star ⭐️!",
"🖼️ Image Inpainting"
]
},
{
"id": 78,
"type": "VAELoader",
"pos": [
910,
-230
],
"size": [
350.65509033203125,
58
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "VAE",
"type": "VAE",
"slot_index": 0,
"links": [
237,
267,
271
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.18",
"Node name for S&R": "VAELoader",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.1",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"hunyuan_video_vae_bf16.safetensors"
]
},
{
"id": 81,
"type": "ModelSamplingSD3",
"pos": [
613.9942626953125,
59.9338493347168
],
"size": [
210,
58
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 250
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"slot_index": 0,
"links": [
239
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.18",
"Node name for S&R": "ModelSamplingSD3",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.1",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
7
]
},
{
"id": 117,
"type": "SaveImage",
"pos": [
1670.939697265625,
-104.6227798461914
],
"size": [
531.0060424804688,
550.45361328125
],
"flags": {},
"order": 17,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 274
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.65"
},
"widgets_values": [
"ComfyUI"
]
},
{
"id": 118,
"type": "LanPaint_ImageEncode",
"pos": [
558,
922
],
"size": [
300,
150
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 266
},
{
"name": "vae",
"type": "VAE",
"link": 267
},
{
"name": "mask",
"type": "MASK",
"link": 268
}
],
"outputs": [
{
"name": "latent",
"type": "LATENT",
"links": [
269
]
}
],
"widgets_values": [],
"properties": {
"Node name for S&R": "LanPaint_ImageEncode",
"cnr_id": "LanPaint"
}
},
{
"id": 119,
"type": "LanPaint_ImageDecode",
"pos": [
1670,
-110
],
"size": [
300,
200
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 270
},
{
"name": "vae",
"type": "VAE",
"link": 271
},
{
"name": "image",
"type": "IMAGE",
"link": 272
},
{
"name": "mask",
"type": "MASK",
"link": 273
},
{
"name": "blend_overlap",
"type": "INT",
"widget": {
"name": "blend_overlap"
}
}
],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
274
]
}
],
"widgets_values": [
9
],
"properties": {
"Node name for S&R": "LanPaint_ImageDecode",
"cnr_id": "LanPaint"
}
}
],
"links": [
[
237,
78,
0,
85,
1,
"VAE"
],
[
239,
81,
0,
110,
0,
"MODEL"
],
[
248,
110,
0,
85,
0,
"LATENT"
],
[
250,
103,
0,
81,
0,
"MODEL"
],
[
251,
85,
0,
86,
0,
"IMAGE"
],
[
252,
94,
0,
104,
0,
"CLIP"
],
[
254,
113,
0,
110,
2,
"CONDITIONING"
],
[
255,
94,
0,
113,
0,
"CLIP"
],
[
258,
104,
0,
114,
0,
"CONDITIONING"
],
[
259,
114,
0,
110,
1,
"CONDITIONING"
],
[
266,
105,
0,
118,
0,
"IMAGE"
],
[
267,
78,
0,
118,
1,
"VAE"
],
[
268,
105,
1,
118,
2,
"MASK"
],
[
269,
118,
0,
110,
3,
"LATENT"
],
[
270,
110,
0,
119,
0,
"LATENT"
],
[
271,
78,
0,
119,
1,
"VAE"
],
[
272,
105,
0,
119,
2,
"IMAGE"
],
[
273,
105,
1,
119,
3,
"MASK"
],
[
274,
119,
0,
117,
0,
"IMAGE"
]
],
"groups": [
{
"id": 1,
"title": "Text Encoding",
"bounding": [
-190,
-140,
730,
340
],
"color": "#8A8",
"font_size": 24,
"flags": {}
},
{
"id": 2,
"title": "VAE Decoding & Output",
"bounding": [
1320,
-140,
1110,
600
],
"color": "#3f789e",
"font_size": 24,
"flags": {}
},
{
"id": 4,
"title": "Sampling Process",
"bounding": [
570,
-140,
730,
980
],
"color": "#3f789e",
"font_size": 24,
"flags": {}
},
{
"id": 5,
"title": "HunyuanVideo Model",
"bounding": [
170,
230,
370.5005798339844,
330.7360534667969
],
"color": "#88A",
"font_size": 24,
"flags": {}
},
{
"id": 6,
"title": "Guidance",
"bounding": [
590,
-90,
680,
260
],
"color": "#8AA",
"font_size": 24,
"flags": {}
},
{
"id": 7,
"title": "sampling",
"bounding": [
590,
200,
680,
440
],
"color": "#b06634",
"font_size": 24,
"flags": {}
}
],
"config": {},
"extra": {
"ds": {
"scale": 0.4870776476432723,
"offset": [
85.03251058761712,
779.6524460150363
]
},
"frontendVersion": "1.27.10",
"groupNodes": {},
"ue_links": [],
"links_added_by_ue": [],
"VHS_latentpreview": false,
"VHS_latentpreviewrate": 0,
"VHS_MetadataImage": true,
"VHS_KeepIntermediate": true
},
"version": 0.4
}