Skip to content

Commit dc36d24

Browse files
Code2Collapseclaude
andcommitted
fix(preview): default to TAESD so Wan/Kijai sampler previews actually show (main)
Port from feat. Kijai's WanVideoSampler routes Auto/Latent2RGB to core's preview (blank for Wan latents — no rgb factors) and any other method to its own taehv/Wan-factor previewer. Default the toggle + guard to TAESD so Wan and core samplers both preview. Drop taew2_1/2.safetensors in models/vae_approx for the sharp version; otherwise the Wan-factor Latent2RGB fallback still shows one. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent a750d73 commit dc36d24

2 files changed

Lines changed: 25 additions & 15 deletions

File tree

js/c2c_preview_toggle.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,28 @@ app.registerExtension({
2929
id: SETTING_ID,
3030
name: "C2C ▸ Sampler latent preview",
3131
tooltip:
32-
"Show the live denoising preview inside the sampler node (native " +
33-
"ComfyUI preview). Auto = Latent2RGB (fast, no model). TAESD = sharper " +
34-
"(needs a models/vae_approx decoder). Off = no preview.",
32+
"Live denoising preview inside the sampler node — works for core " +
33+
"KSampler AND Kijai WanVideoSampler. 'Wan/video-aware' uses the " +
34+
"TAESD path, which routes Wan samplers to their own video previewer " +
35+
"(taehv if you drop taew2_1/taew2_2.safetensors in models/vae_approx, " +
36+
"otherwise a Wan-factor Latent2RGB fallback) — this is the one that " +
37+
"makes Wan/Kijai previews actually appear. 'Fast' is core Latent2RGB " +
38+
"(good for SD/Flux, blank for Wan). 'Off' = no preview.",
3539
type: "combo",
3640
options: [
37-
{ text: "Auto (Latent2RGB — fast, no model)", value: "auto" },
38-
{ text: "TAESD (sharper, needs vae_approx model)", value: "taesd" },
41+
{ text: "On — Wan/video-aware (recommended)", value: "taesd" },
42+
{ text: "On — fast, SD/Flux only (Latent2RGB)", value: "latent2rgb" },
3943
{ text: "Off", value: "off" },
4044
],
41-
defaultValue: "auto",
42-
onChange: (v) => { applyMethod(v || "auto"); },
45+
defaultValue: "taesd",
46+
onChange: (v) => { applyMethod(v || "taesd"); },
4347
},
4448
],
4549
async setup() {
4650
// Push the saved choice to the server on load so it persists across restarts.
47-
const v = app.ui?.settings?.getSettingValue?.(SETTING_ID, "auto") || "auto";
51+
// Default TAESD so Wan/Kijai samplers route to their own video previewer
52+
// (core Auto/Latent2RGB shows nothing for Wan latents).
53+
const v = app.ui?.settings?.getSettingValue?.(SETTING_ID, "taesd") || "taesd";
4854
applyMethod(v);
4955
},
5056
});

nodes/_c2c_preview_guard.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,22 @@ def ensure_previews_enabled() -> str:
5656
try:
5757
cur = getattr(args, "preview_method", None)
5858
if cur == LatentPreviewMethod.NoPreviews:
59-
# Prefer the module helper if present (handles its own state).
59+
# Force TAESD, not Auto. TAESD is the universal method: core samplers
60+
# use the taesd decoder (or fall back to Latent2RGB), and — crucially —
61+
# Kijai's WanVideoSampler routes TAESD to its OWN video previewer
62+
# (taehv / Wan-factor Latent2RGB), so Wan/video previews actually show.
63+
# Auto resolves to core Latent2RGB, which is BLANK for Wan latents.
6064
try:
6165
import latent_preview # noqa: F401
6266
if hasattr(latent_preview, "set_preview_method"):
63-
latent_preview.set_preview_method("auto")
67+
latent_preview.set_preview_method("taesd")
6468
else:
65-
args.preview_method = LatentPreviewMethod.Auto
69+
args.preview_method = LatentPreviewMethod.TAESD
6670
except Exception:
67-
args.preview_method = LatentPreviewMethod.Auto
68-
PREVIEW_GUARD_STATUS = "forced_auto (was none)"
69-
log.info("[c2c.preview] previews were OFF (--preview-method none) -> forced to Auto "
70-
"(Latent2RGB; no model, cannot fail). Set C2C_NO_FORCE_PREVIEW=1 to opt out.")
71+
args.preview_method = LatentPreviewMethod.TAESD
72+
PREVIEW_GUARD_STATUS = "forced_taesd (was none)"
73+
log.info("[c2c.preview] previews were OFF (--preview-method none) -> forced to TAESD "
74+
"(works for core AND Kijai/Wan samplers). Set C2C_NO_FORCE_PREVIEW=1 to opt out.")
7175
else:
7276
PREVIEW_GUARD_STATUS = f"already_on ({getattr(cur, 'value', cur)})"
7377
log.debug("[c2c.preview] previews already enabled: %s", cur)

0 commit comments

Comments
 (0)