SeedVR2-1.4B / comfyui /seedvr2_1.4b_tinyvae_upscale_image.json
lvladikov's picture
fix: VAELoader pointed at the distilled VAE; document real verification
a47293e verified
Raw
History Blame Contribute Delete
32.1 kB
{
"id": "seedvr2-1.4b-tinyvae-upscale",
"revision": 0,
"last_node_id": 75,
"last_link_id": 66,
"nodes": [
{
"id": 1,
"type": "LoadImage",
"pos": [
180,
-20
],
"size": [
360,
400
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
46,
59
]
},
{
"name": "MASK",
"type": "MASK",
"links": [
47
]
}
],
"properties": {
"Node name for S&R": "LoadImage",
"cnr_id": "comfy-core",
"ver": "0.27.0"
},
"widgets_values": [
"indoor_portrait.png",
"image"
]
},
{
"id": 9,
"type": "SaveImage",
"pos": [
1030,
-20
],
"size": [
380,
430
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 49
}
],
"outputs": [
{
"name": "images",
"type": "IMAGE",
"links": [
37
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.27.0",
"Node name for S&R": "SaveImage"
},
"widgets_values": [
"seedvr2_after/image"
]
},
{
"id": 65,
"type": "ImageCompare",
"pos": [
1460,
-20
],
"size": [
450,
430
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "image_a",
"shape": 7,
"type": "IMAGE",
"link": 59
},
{
"name": "image_b",
"shape": 7,
"type": "IMAGE",
"link": 37
}
],
"outputs": [],
"properties": {
"Node name for S&R": "ImageCompare",
"cnr_id": "comfy-core",
"ver": "0.27.0"
},
"widgets_values": []
},
{
"id": 66,
"type": "1970dcb4-982a-4c01-a373-4d239a3041e4",
"pos": [
580,
-20
],
"size": [
410,
450
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 46
},
{
"name": "alpha",
"type": "MASK",
"link": 47
},
{
"label": "scale_multiplier",
"name": "resize_type.multiplier",
"type": "FLOAT",
"widget": {
"name": "resize_type.multiplier"
},
"link": null
}
],
"outputs": [
{
"name": "images",
"type": "IMAGE",
"links": [
49
]
}
],
"properties": {
"proxyWidgets": [
[
"57",
"resize_type.multiplier"
],
[
"54",
"seed"
],
[
"54",
"sampler_name"
],
[
"54",
"scheduler"
],
[
"54",
"denoise"
],
[
"52",
"unet_name"
],
[
"51",
"vae_name"
],
[
"59",
"color_correction_method"
]
],
"cnr_id": "comfy-core",
"ver": "0.27.0"
},
"widgets_values": [],
"title": "Upscale Image (SeedVR2 1.4B + distilled VAE)"
},
{
"id": 72,
"type": "MarkdownNote",
"pos": [
-360,
-20
],
"size": [
500,
760
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [],
"title": "Note: Model Links",
"properties": {},
"widgets_values": [
"## SeedVR2-1.4B + distilled VAE decoder\n\nSame graph as `seedvr2_1.4b_upscale_image.json`. One difference: a second custom node swaps the\ndecoder implementation at import time. The VAELoader still loads the STOCK VAE.\n\n**Install BOTH custom nodes** into `ComfyUI/custom_nodes/`, then restart:\n- `ComfyUI-SeedVR2-1.4B` — 6-block detection + single-frame VAE fast path. **Still required**: the\n ENCODER is untouched and is still a 3-D causal-conv stack.\n- `ComfyUI-SeedVR2-1.4B-TinyVAE` — replaces the 150.6M-param decoder with a 1.35M-param one.\n\n### Files\n- `comfyui/seedvr2_distill_6L_1.4B_sharp_fp16_comfyui.safetensors` -> `models/diffusion_models/`\n- `ema_vae_fp16.safetensors` -> `models/vae/seedvr2_ema_vae_fp16.safetensors` — the **stock** SeedVR2 VAE (rename on copy). This is what the\n VAELoader in this workflow loads. ComfyUI identifies a SeedVR2 VAE by a stock decoder key,\n so only this file is selectable there.\n- `comfyui/ema_vae_distill_fp16.safetensors` -> `models/vae/` (or beside the custom-node folder,\n or `SEEDVR2_TINYVAE_PATH`). **Do NOT select this one in the VAELoader** — it will fail with\n `VAE is invalid: None`, because the distilled decoder replaces the very keys ComfyUI uses to\n recognise a SeedVR2 VAE. It is never loaded as a VAE: the TinyVAE node finds it on disk and\n patches the decoder at import time. 202.8 MB, encoder bit-identical + distilled decoder.\n\n### FIRST RUN — check the calibration line\nThe node measures the latent convention on its first tile instead of assuming it. In the log:\n\n SeedVR2 TinyVAE: patched VideoAutoencoderKL.decode_\n SeedVR2 TinyVAE calibrate: pre-scaled by ComfyUI -> 34.92 dB\n SeedVR2 TinyVAE calibrate: raw latent -> 33.25 dB\n SeedVR2 TinyVAE: calibrated — pre-scaled by ComfyUI, 34.92 dB vs the stock decoder.\n\nThat is the confirmation it is working. If neither option clears 28 dB the node disables itself and\nyou get the stock decoder plus a warning — never a fast-but-wrong image. If you see no TinyVAE lines\nat all, the node did not load and you are on the stock decoder.\n\n### What it buys (M2 Ultra, 6L transformer fixed)\n| job | VAE decode | whole run | peak RAM |\n|---|---|---|---|\n| 512 -> 2048 | 4.12s -> 0.34s (12.1x) | 17.6 -> 13.9s | 7.49 -> 4.74 GB |\n| 512 -> 4096 | 15.55s -> 1.10s (14.2x) | 52.0 -> 37.9s | 7.70 -> 4.95 GB |\n| 2048 -> 8192 | 68.35s -> 5.00s (13.7x) | 203.7 -> 140.3s | 7.76 -> 5.02 GB |\n\n### What it costs\nA mild low-pass: ~84-97% of mid-band energy, ~61-68% of fine, ~21-26% of the top edge band.\nSome material shows it, some does not — check your own images at 1:1.\n`SEEDVR2_TINYVAE_OFF=1` gives a clean A/B against the stock decoder with everything else identical.\n\n### Notes (unchanged from the base workflow)\n- Upscale factor = `scale_multiplier`. 4x recommended.\n- One-step by design: steps 1, cfg 1, euler, simple, denoise 1.\n- **Do NOT raise the VAE `tile_size` above 512** — attention is quadratic in tile tokens.\n"
],
"color": "#222",
"bgcolor": "#000"
}
],
"links": [
[
37,
9,
0,
65,
1,
"IMAGE"
],
[
46,
1,
0,
66,
0,
"IMAGE"
],
[
47,
1,
1,
66,
1,
"MASK"
],
[
49,
66,
0,
9,
0,
"IMAGE"
],
[
59,
1,
0,
65,
0,
"IMAGE"
]
],
"groups": [],
"definitions": {
"subgraphs": [
{
"id": "1970dcb4-982a-4c01-a373-4d239a3041e4",
"version": 1,
"state": {
"lastGroupId": 1,
"lastNodeId": 75,
"lastLinkId": 66,
"lastRerouteId": 0
},
"revision": 0,
"config": {},
"name": "Upscale Image (SeedVR2 1.4B + distilled VAE)",
"inputNode": {
"id": -10,
"bounding": [
470,
59.901214308973096,
189.134765625,
247.99999999999997
]
},
"outputNode": {
"id": -20,
"bounding": [
2480,
201,
128,
68
]
},
"inputs": [
{
"id": "e981cdcd-e740-4932-91e0-06392d5ac526",
"name": "image",
"type": "IMAGE",
"linkIds": [
41
],
"localized_name": "image",
"pos": [
635.134765625,
83.9012143089731
]
},
{
"id": "bd600399-ea77-48ba-91f6-cf83c95051c8",
"name": "alpha",
"type": "MASK",
"linkIds": [
40
],
"localized_name": "alpha",
"pos": [
635.134765625,
103.9012143089731
]
},
{
"id": "df3b8dbd-5649-4dbd-8551-c5cb254eafc5",
"name": "resize_type.multiplier",
"type": "FLOAT",
"linkIds": [
50
],
"label": "scale_multiplier",
"pos": [
635.134765625,
123.9012143089731
]
},
{
"id": "9bf1e154-0009-45fb-a43c-ae3fc9361b37",
"name": "seed",
"type": "INT",
"linkIds": [
51
],
"pos": [
635.134765625,
143.9012143089731
]
},
{
"id": "408ed65b-0681-4ffc-93dd-cab04ffabe06",
"name": "sampler_name",
"type": "COMBO",
"linkIds": [
54
],
"pos": [
635.134765625,
163.9012143089731
]
},
{
"id": "dbd3e56e-9696-41fa-8549-9f65dcf34b8e",
"name": "scheduler",
"type": "COMBO",
"linkIds": [
55
],
"pos": [
635.134765625,
183.9012143089731
]
},
{
"id": "fe2df403-641b-4d01-87a7-0f730febd917",
"name": "denoise",
"type": "FLOAT",
"linkIds": [
56
],
"pos": [
635.134765625,
203.9012143089731
]
},
{
"id": "7739a0b8-6e3a-4788-a671-dadd904c2d87",
"name": "unet_name",
"type": "COMBO",
"linkIds": [
57
],
"pos": [
635.134765625,
223.9012143089731
]
},
{
"id": "2de2f222-32fd-402f-98da-73cf111b2f37",
"name": "vae_name",
"type": "COMBO",
"linkIds": [
58
],
"pos": [
635.134765625,
243.9012143089731
]
},
{
"id": "6b8a6fef-e542-4fb4-9a4e-a3c0d46cd6b7",
"name": "color_correction_method",
"type": "COMBO",
"linkIds": [
64
],
"pos": [
635.134765625,
263.90121430897307
]
}
],
"outputs": [
{
"id": "517ebe35-9129-4f66-a88e-2fdca4c417cf",
"name": "images",
"type": "IMAGE",
"linkIds": [
15
],
"localized_name": "images",
"pos": [
2504,
225
]
}
],
"widgets": [],
"nodes": [
{
"id": 48,
"type": "VAEEncodeTiled",
"pos": [
1360,
110
],
"size": [
270,
230
],
"flags": {},
"order": 0,
"mode": 0,
"showAdvanced": true,
"inputs": [
{
"localized_name": "pixels",
"name": "pixels",
"type": "IMAGE",
"link": 16
},
{
"localized_name": "vae",
"name": "vae",
"type": "VAE",
"link": 17
}
],
"outputs": [
{
"localized_name": "LATENT",
"name": "LATENT",
"type": "LATENT",
"links": [
28,
36
]
}
],
"properties": {
"Node name for S&R": "VAEEncodeTiled",
"cnr_id": "comfy-core",
"ver": "0.27.0"
},
"widgets_values": [
512,
128,
4096,
8
]
},
{
"id": 50,
"type": "JoinImageWithAlpha",
"pos": [
930,
240
],
"size": [
280,
80
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"localized_name": "image",
"name": "image",
"type": "IMAGE",
"link": 41
},
{
"localized_name": "alpha",
"name": "alpha",
"type": "MASK",
"link": 40
}
],
"outputs": [
{
"localized_name": "IMAGE",
"name": "IMAGE",
"type": "IMAGE",
"links": [
45
]
}
],
"properties": {
"Node name for S&R": "JoinImageWithAlpha",
"cnr_id": "comfy-core",
"ver": "0.27.0"
},
"widgets_values": []
},
{
"id": 51,
"type": "VAELoader",
"pos": [
940,
100
],
"size": [
270,
80
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"localized_name": "vae_name",
"name": "vae_name",
"type": "COMBO",
"widget": {
"name": "vae_name"
},
"link": 58
}
],
"outputs": [
{
"localized_name": "VAE",
"name": "VAE",
"type": "VAE",
"links": [
17,
22
]
}
],
"properties": {
"Node name for S&R": "VAELoader",
"cnr_id": "comfy-core",
"ver": "0.27.0",
"models": [
{
"name": "seedvr2_ema_vae_fp16.safetensors",
"url": "https://huggingface.co/lvladikov/SeedVR2-1.4B/resolve/main/ema_vae_fp16.safetensors",
"directory": "vae"
}
]
},
"widgets_values": [
"seedvr2_ema_vae_fp16.safetensors"
]
},
{
"id": 52,
"type": "UNETLoader",
"pos": [
940,
-70
],
"size": [
270,
110
],
"flags": {},
"order": 3,
"mode": 0,
"showAdvanced": false,
"inputs": [
{
"localized_name": "unet_name",
"name": "unet_name",
"type": "COMBO",
"widget": {
"name": "unet_name"
},
"link": 57
}
],
"outputs": [
{
"localized_name": "MODEL",
"name": "MODEL",
"type": "MODEL",
"links": [
27,
31
]
}
],
"properties": {
"Node name for S&R": "UNETLoader",
"cnr_id": "comfy-core",
"ver": "0.27.0",
"models": [
{
"name": "seedvr2_distill_6L_1.4B_sharp_fp16_comfyui.safetensors",
"url": "https://huggingface.co/lvladikov/SeedVR2-1.4B/resolve/main/comfyui/seedvr2_distill_6L_1.4B_sharp_fp16_comfyui.safetensors",
"directory": "diffusion_models"
}
]
},
"widgets_values": [
"seedvr2_distill_6L_1.4B_sharp_fp16_comfyui.safetensors",
"default"
]
},
{
"id": 54,
"type": "KSampler",
"pos": [
1740,
-40
],
"size": [
270,
320
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"localized_name": "model",
"name": "model",
"type": "MODEL",
"link": 31
},
{
"localized_name": "positive",
"name": "positive",
"type": "CONDITIONING",
"link": 29
},
{
"localized_name": "negative",
"name": "negative",
"type": "CONDITIONING",
"link": 30
},
{
"localized_name": "latent_image",
"name": "latent_image",
"type": "LATENT",
"link": 36
},
{
"localized_name": "seed",
"name": "seed",
"type": "INT",
"widget": {
"name": "seed"
},
"link": 51
},
{
"localized_name": "sampler_name",
"name": "sampler_name",
"type": "COMBO",
"widget": {
"name": "sampler_name"
},
"link": 54
},
{
"localized_name": "scheduler",
"name": "scheduler",
"type": "COMBO",
"widget": {
"name": "scheduler"
},
"link": 55
},
{
"localized_name": "denoise",
"name": "denoise",
"type": "FLOAT",
"widget": {
"name": "denoise"
},
"link": 56
}
],
"outputs": [
{
"localized_name": "LATENT",
"name": "LATENT",
"type": "LATENT",
"links": [
21
]
}
],
"properties": {
"Node name for S&R": "KSampler",
"cnr_id": "comfy-core",
"ver": "0.27.0"
},
"widgets_values": [
959948902156062,
"fixed",
1,
1,
"euler",
"simple",
1
]
},
{
"id": 55,
"type": "VAEDecodeTiled",
"pos": [
2110,
-40
],
"size": [
270,
230
],
"flags": {},
"order": 5,
"mode": 0,
"showAdvanced": true,
"inputs": [
{
"localized_name": "samples",
"name": "samples",
"type": "LATENT",
"link": 21
},
{
"localized_name": "vae",
"name": "vae",
"type": "VAE",
"link": 22
}
],
"outputs": [
{
"localized_name": "IMAGE",
"name": "IMAGE",
"type": "IMAGE",
"links": [
25
]
}
],
"properties": {
"Node name for S&R": "VAEDecodeTiled",
"cnr_id": "comfy-core",
"ver": "0.27.0"
},
"widgets_values": [
512,
128,
4096,
8
]
},
{
"id": 57,
"type": "ResizeImageMaskNode",
"pos": [
930,
370
],
"size": [
270,
110
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"localized_name": "input",
"name": "input",
"type": "IMAGE,MASK",
"link": 45
},
{
"localized_name": "resize_type.multiplier",
"name": "resize_type.multiplier",
"type": "FLOAT",
"widget": {
"name": "resize_type.multiplier"
},
"link": 50
}
],
"outputs": [
{
"localized_name": "resized",
"name": "resized",
"type": "IMAGE",
"links": [
24,
26
]
}
],
"properties": {
"Node name for S&R": "ResizeImageMaskNode",
"cnr_id": "comfy-core",
"ver": "0.27.0"
},
"widgets_values": [
"scale by multiplier",
4,
"lanczos"
]
},
{
"id": 58,
"type": "SeedVR2Preprocess",
"pos": [
930,
570
],
"size": [
270,
60
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"localized_name": "resized_images",
"name": "resized_images",
"type": "IMAGE",
"link": 24
}
],
"outputs": [
{
"localized_name": "images",
"name": "images",
"type": "IMAGE",
"links": [
16
]
}
],
"properties": {
"Node name for S&R": "SeedVR2Preprocess",
"cnr_id": "comfy-core",
"ver": "0.27.0"
},
"widgets_values": []
},
{
"id": 59,
"type": "SeedVR2PostProcessing",
"pos": [
2110,
350
],
"size": [
310,
110
],
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"localized_name": "images",
"name": "images",
"type": "IMAGE",
"link": 25
},
{
"localized_name": "original_resized_images",
"name": "original_resized_images",
"type": "IMAGE",
"link": 26
},
{
"localized_name": "color_correction_method",
"name": "color_correction_method",
"type": "COMBO",
"widget": {
"name": "color_correction_method"
},
"link": 64
}
],
"outputs": [
{
"localized_name": "images",
"name": "images",
"type": "IMAGE",
"links": [
15
]
}
],
"properties": {
"Node name for S&R": "SeedVR2PostProcessing",
"cnr_id": "comfy-core",
"ver": "0.27.0"
},
"widgets_values": [
"none"
]
},
{
"id": 61,
"type": "SeedVR2Conditioning",
"pos": [
1330,
-40
],
"size": [
270,
80
],
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"localized_name": "model",
"name": "model",
"type": "MODEL",
"link": 27
},
{
"label": "latent",
"localized_name": "vae_conditioning",
"name": "vae_conditioning",
"type": "LATENT",
"link": 28
}
],
"outputs": [
{
"localized_name": "positive",
"name": "positive",
"type": "CONDITIONING",
"links": [
29
]
},
{
"localized_name": "negative",
"name": "negative",
"type": "CONDITIONING",
"links": [
30
]
}
],
"properties": {
"Node name for S&R": "SeedVR2Conditioning",
"cnr_id": "comfy-core",
"ver": "0.27.0"
},
"widgets_values": []
}
],
"groups": [
{
"id": 1,
"title": "Models",
"bounding": [
930,
-140,
290,
330.15625
],
"color": "#3f789e",
"flags": {}
}
],
"links": [
{
"id": 16,
"origin_id": 58,
"origin_slot": 0,
"target_id": 48,
"target_slot": 0,
"type": "IMAGE"
},
{
"id": 17,
"origin_id": 51,
"origin_slot": 0,
"target_id": 48,
"target_slot": 1,
"type": "VAE"
},
{
"id": 31,
"origin_id": 52,
"origin_slot": 0,
"target_id": 54,
"target_slot": 0,
"type": "MODEL"
},
{
"id": 29,
"origin_id": 61,
"origin_slot": 0,
"target_id": 54,
"target_slot": 1,
"type": "CONDITIONING"
},
{
"id": 30,
"origin_id": 61,
"origin_slot": 1,
"target_id": 54,
"target_slot": 2,
"type": "CONDITIONING"
},
{
"id": 36,
"origin_id": 48,
"origin_slot": 0,
"target_id": 54,
"target_slot": 3,
"type": "LATENT"
},
{
"id": 21,
"origin_id": 54,
"origin_slot": 0,
"target_id": 55,
"target_slot": 0,
"type": "LATENT"
},
{
"id": 22,
"origin_id": 51,
"origin_slot": 0,
"target_id": 55,
"target_slot": 1,
"type": "VAE"
},
{
"id": 45,
"origin_id": 50,
"origin_slot": 0,
"target_id": 57,
"target_slot": 0,
"type": "IMAGE"
},
{
"id": 24,
"origin_id": 57,
"origin_slot": 0,
"target_id": 58,
"target_slot": 0,
"type": "IMAGE"
},
{
"id": 25,
"origin_id": 55,
"origin_slot": 0,
"target_id": 59,
"target_slot": 0,
"type": "IMAGE"
},
{
"id": 26,
"origin_id": 57,
"origin_slot": 0,
"target_id": 59,
"target_slot": 1,
"type": "IMAGE"
},
{
"id": 27,
"origin_id": 52,
"origin_slot": 0,
"target_id": 61,
"target_slot": 0,
"type": "MODEL"
},
{
"id": 28,
"origin_id": 48,
"origin_slot": 0,
"target_id": 61,
"target_slot": 1,
"type": "LATENT"
},
{
"id": 41,
"origin_id": -10,
"origin_slot": 0,
"target_id": 50,
"target_slot": 0,
"type": "IMAGE"
},
{
"id": 40,
"origin_id": -10,
"origin_slot": 1,
"target_id": 50,
"target_slot": 1,
"type": "MASK"
},
{
"id": 15,
"origin_id": 59,
"origin_slot": 0,
"target_id": -20,
"target_slot": 0,
"type": "IMAGE"
},
{
"id": 50,
"origin_id": -10,
"origin_slot": 2,
"target_id": 57,
"target_slot": 1,
"type": "FLOAT"
},
{
"id": 51,
"origin_id": -10,
"origin_slot": 3,
"target_id": 54,
"target_slot": 4,
"type": "INT"
},
{
"id": 54,
"origin_id": -10,
"origin_slot": 4,
"target_id": 54,
"target_slot": 5,
"type": "COMBO"
},
{
"id": 55,
"origin_id": -10,
"origin_slot": 5,
"target_id": 54,
"target_slot": 6,
"type": "COMBO"
},
{
"id": 56,
"origin_id": -10,
"origin_slot": 6,
"target_id": 54,
"target_slot": 7,
"type": "FLOAT"
},
{
"id": 57,
"origin_id": -10,
"origin_slot": 7,
"target_id": 52,
"target_slot": 0,
"type": "COMBO"
},
{
"id": 58,
"origin_id": -10,
"origin_slot": 8,
"target_id": 51,
"target_slot": 0,
"type": "COMBO"
},
{
"id": 64,
"origin_id": -10,
"origin_slot": 9,
"target_id": 59,
"target_slot": 2,
"type": "COMBO"
}
],
"extra": {}
}
]
},
"config": {},
"extra": {
"ds": {
"scale": 0.8369606986899568,
"offset": [
729.0799452315996,
332.21687102746415
]
},
"frontendVersion": "1.45.15",
"VHS_latentpreview": false,
"VHS_latentpreviewrate": 0,
"VHS_MetadataImage": true,
"VHS_KeepIntermediate": true
},
"version": 0.4
}
MiniMax H3 Video Generator 20 free credits · Text & image to video Try Free →