ComfyUI 24-Frame Coherent Animation · APNG / WebP / GIF
In a nutshell: Three keyframes (neutral → A → B) → 24 LatentInterpolate ratios → 24 VAE decodes → ImageBatchMulti → three save nodes.
No batch_size frame stacking, no external script compositing, no intermediate files saved—one Queue produces one final output file.
0 · Quick Reference Table
| Item | xl Environment | Dit Environment |
|---|---|---|
| ComfyUI Root | D:\ComfyUI-aki-v3.2-xl\ComfyUI | D:\ComfyUI-aki-v3.2-Dit\ComfyUI |
| Python | D:\ComfyUI-aki-v3.2-xl\python\python.exe | D:\ComfyUI-aki-v3.2-Dit\python\python.exe |
| Version | ComfyUI 0.46.2 / torch 2.13.0+cu130 | ComfyUI 0.46.0 / torch 2.13.0+cu132 |
| Common | Python 3.13.11 / Pillow 12.1.0 / RTX 5070 Ti Laptop 12GB | Same as left |
The table below is a local instance, not a specification. When switching machines, run
python scripts/detect_env.pyfirst. Paths, ports, model names, and versions are all stored inprofiles/*.json; theD:\...paths in the text are just examples—the scripts don't depend on them. | Model |checkpoints\NovaAnimeILV190.safetensors|diffusion_models\moss_image_base_8stepdmd_int8_convrot.safetensors+text_encoders\qwen3.5_9b_moss_image_sft_w4a8_gptq.safetensors(type=moss_image) +vae\moss_image_vae_bf16.safetensors| | Workflow |user\default\workflows\APNG-MultiFrame-SDXL.json|user\default\workflows\APNG-MultiFrame-Moss.json| | Default Port | 8188 (verify with 8190) | 8189 (verify with 8191) | | Keyframe denoise | 0.4 | 0.5 | | Sampling | 20 steps / cfg 6.0 / euler_ancestral / normal | 8 steps / cfg 1.0 / euler / simple |
The two workflows are not the same: loaders and sampling parameters differ, but the node structure and 24-frame curve are identical.
Required plugins: comfyui-kjnodes (ImageBatchMulti), ComfyUI-VideoHelperSuite (Video Combine for GIF). Both environments have them installed.
Start verification (avoid occupying the default draw ports):
& 'D:\ComfyUI-aki-v3.2-xl\python\python.exe' -s 'D:\ComfyUI-aki-v3.2-xl\ComfyUI\main.py' --port 8190 --listen 127.0.0.1
& 'D:\ComfyUI-aki-v3.2-Dit\python\python.exe' -s 'D:\ComfyUI-aki-v3.2-Dit\ComfyUI\main.py' --port 8191 --listen 127.0.0.1
netstat -ano | findstr ":8190 :8191"
Always clean up with Stop-Process -Id <PID> and confirm ports are released, otherwise the draw-start launcher will report port conflicts.
0.1 Current State (2006-11-23 Measured Results)
| Version | Environment | Adjacent Frame Difference | Color Drift | Conclusion |
|---|---|---|---|---|
| New (denoise 0.35 + linear + global action) | xl | 0.12 – 2.35, avg 1.08 | 2.63 | Current default, no flicker |
| Old (denoise 0.55 + power curve) | xl | 0.95 – 5.42, avg 2.34 | 3.07 | Color banding in mid-section, deprecated |
| Historical | Dit | 0.06 – 3.04, avg 1.43 | — | Structure synced to new default, not retested |
xl's stable upper limit is around denoise 0.35: at 0.42, color drift rises to ~8, clothes and background start being redrawn; at 0.45, clothes turn blue. For more expressive faces, prioritize increasing frame count or doing facial inpainting, don't just raise denoise.
0.2 How to Use This Skill's Sequence
- First, read the online workflow file (
user/default/workflows/APNG-MultiFrame-*.json); the files inassets/are snapshots taken at the time of capture—the user may have modified them. - Any changes must be applied to both environments simultaneously: xl and Dit share the same node structure, only loaders, sampling parameters, and denoise differ.
- After making changes, have the user refresh the browser page before Queuing; otherwise, the frontend still holds the old nodes and prefixes.
- Always verify using ports 8190 / 8191, and clean up ports afterward.
0.3 Startup and Offline Configuration (Archived Session Conclusions)
- Both environments'
ComfyUI\user\__manager\config.iniare already set tonetwork_mode = offline,security_level = normal. No moreFETCH ComfyRegistry DataorCannot connect to raw.githubusercontent.comon startup. The remainingWinError 10022comes from other plugins trying to connect and being reset, which doesn't affect image generation. - When only verifying workflows, use a whitelist startup—don't load all custom nodes (verified to work):
& 'D:\ComfyUI-aki-v3.2-xl\python\python.exe' -s 'D:\ComfyUI-aki-v3.2-xl\ComfyUI\main.py' --port 8190 --listen 127.0.0.1 --disable-all-custom-nodes --whitelist-custom-nodes comfyui-kjnodes ComfyUI-VideoHelperSuite --disable-manager-ui --disable-product-tips --disable-auto-launch
- Always end with
Stop-Process -Id <PID>, thennetstat -ano | findstr ":8190"to confirm ports are free. The draw-start launcher defaults to 8188 (xl) / 8189 (Dit); don't use these for verification. - Archived note: two instances where a verification instance was not closed, and the draw-start launcher reported port conflicts (once each on 8188 and 8189).
0.4 Source of This Skill (Three Archived Sessions)
| Session | Time | Contribution |
|---|---|---|
| Original Build | 2026-11-22 15:35 → 11-23 00:53 | batch_size failure → 8-frame same-source redraw → three keyframe interpolation → 24 frames, three formats; directory structure; save only final files |
| Sequel | 2026-11-23 08:54 → 11:41 | xl closed eyes causing iris color change → eyes half closed, denoise 0.4; unified "no flicker" across both environments |
| Handoff | 2026-11-23 11:38 → 11:49 | SKILL.md draft, script commit, external info verification |
Requirements not implemented in the first two sessions (added to Section 5 in this version): storyboard action guidance, sticker narrative core, multi-character and arbitrary actions, style/hair/eye color locking.
0.5 Changing Machines: Three Steps
python scripts/detect_env.py # 1 Scan local ComfyUI, write profiles/*.json
python scripts/doctor.py # 2 Comprehensive check (models/plugins/nodes/output dirs/ports)
python scripts/emit_workflow.py --base assets/workflow-sdxl.json --story assets/story.4beat.json --out my-4beat.json
emit_workflow.py recognizes structure, not model names: as long as the base has "1 KSampler with denoise=1 + ≥2 keyframe KSamplers + 24 LatentInterpolate + 24 VAEDecode + ImageBatchMulti(24) + three outputs", it can be expanded to 3–5 beats. To change models, just replace the loader in the base with your own (CheckpointLoaderSimple or UNETLoader+CLIPLoader+VAELoader are fine), don't touch anything else.
Model-to-denoise mapping (empirical stable upper limits tested with same seed):
| Model Family | Loader | Keyframe denoise |
|---|---|---|
| SD 1.5 | CheckpointLoaderSimple | 0.45–0.55 |
| SDXL / Illustrious / NoobAI | CheckpointLoaderSimple | 0.35–0.45 |
| FLUX.1 | UNETLoader + DualCLIPLoader + VAELoader | 0.45–0.55 (add FluxGuidance before) |
| Moss / DiT | UNETLoader + CLIPLoader (type=moss_image) + VAELoader | 0.50–0.55 |
0.5.1 What You Can Change in the Workflow
Each generated workflow has these three layers; open and adjust:
| Scope | Node | What to Change |
|---|---|---|
| Whole clip | CLIPTextEncode "Global Action Guide (shared by all keyframes)" | Action, camera, lighting, style; change one place, all keyframes apply |
| Per frame | CLIPTextEncode "K0 / K1 / … prompt" | Expression, pose, gaze |
| Per frame sampling | Each KSampler | seed, steps, cfg, sampler, scheduler, denoise |
| Timing | 24 LatentInterpolate ratios | linear most uniform, ease slow at both ends, snap old behavior |
| Speed | fps of three save nodes | All three must match (10fps × 24 = 2.4 seconds) |
| Quality | APNG compress_level, WebP lossless/quality, VHS loop/pingpong | Size and playback |
CLI corresponding parameters: --motion --curve --seed --denoise --steps --cfg. A Note node in the canvas keeps this table nearby.
To confirm it works before generating, add --run:
python scripts/emit_workflow.py --validate my-4beat.json --run --profile profiles/xl.json
This calls /object_info to validate nodes, converts the workflow to API format, submits it, polls /history, prints the output path, and automatically runs check_anim.py.
0.6 Script Matrix
| Script | Purpose | Dependencies |
|---|---|---|
detect_env.py | Scan local ComfyUI: version, Python, model list, plugins, running ports, available workflows → profiles/*.json | None |
doctor.py | Check against profile: files, models, plugins, node types, output dir writable, port alive | None (port check requires network) |
emit_workflow.py | 3 keyframes → K beats (3–5); compile story card prompts; recalculate curves; validate connections; optional --run to generate directly | None |
check_anim.py | Frame count, duration, loop, adjacent frame difference, duplicate frames, color drift | Pillow |
make_curve.py | Output ratio curves alone, for timing adjustments | None |
make_preview.py | Re-encode final APNG to web preview: global palette + dithered GIF, true-color WebP | Pillow |
comfy_lib.py | Shared library: profile, HTTP, curves, UI→API conversion | None |
Measured locally (2026-11-23, new defaults): xl 3 beats = 66 nodes, 4 beats = 69 nodes; Dit 3 beats = 68 nodes, 4 beats = 71 nodes.
--run produces 24-frame final files in three formats; check_anim all pass with frames=24 / loop=0 / EXIT=0;
The preview at denoise 0.35 has adjacent frame differences of 0.12–2.35 (avg 1.08), color drift 2.63.
0.7 Dependencies and Distribution
Self-check dependencies (no network, no image generation):
python scripts/check_deps.py
| Dependency | Version | Required | Consequences if Missing |
|---|---|---|---|
| Python | ≥ 3.9 | Yes | Scripts won't run |
| Pillow | ≥ 9.0 | Validation only | check_anim.py unavailable; output generation unaffected |
| ComfyUI | ≥ 0.3 (with SaveAnimatedPNG / SaveAnimatedWEBP) | Yes | Save nodes don't exist |
comfyui-kjnodes | Any | Yes | ImageBatchMulti turns red |
ComfyUI-VideoHelperSuite | Any | No | Only GIF missing; APNG/WebP work fine |
curl | Any | No | HTTP fallback for --run fails (not needed for normal network) |
Where Pillow is installed matters: check_deps.py will also list whether Pillow is available in each environment's Python from the profiles. Use ComfyUI's built-in interpreter for checks, much easier than installing packages in your system Python.
Three distribution forms:
| Form | Command | Use Case |
|---|---|---|
| Directory copy | python scripts/install.py --dest <skills directory> | Multiple local installs (Codex / magpie) |
| Zip archive | python scripts/package.py → dist/comfyui-apng-motion-<ver>.zip + .sha256 | Offline distribution, sharing |
| Git repository | Just add the whole directory (.gitignore already excludes dist / profiles / backups) | Team collaboration, version tracking |
install.py backs up the old SKILL.md as SKILL.md.bak-<timestamp> before overwriting; it does not copy profiles/ by default (those are local artifacts). Add --with-profiles to include them.
0.8 One Skill, Two Entry Points
Not two skills. The single source is E:\Documents\zezeze\tools\comfyui-apng\skill; the two installations are just entry points for different loaders:
| Path | Who Reads It |
|---|---|
~/.codex/skills/comfyui-apng-motion | Codex native skills |
~/.config/magpie/library/skills/comfyui-apng-motion | magpie library |
Prevent drift:
python scripts/install.py --check # Hash-compare file by file, output SAME / DRIFT
To have only one physical copy, you can use junctions (Windows) / symlinks:
python scripts/install.py --link
Trade-off: the installation depends on the source directory existing; moving the source directory breaks it. The default remains copy (resistant to moves), with --check to catch drift.
1 · Why This Approach (Every Decision Explained)
| Practice | Reason |
|---|---|
Don't use batch_size=24 | batch_size=N produces N independent noise samples. A fixed seed only guarantees reproducibility, not continuity—playback will always flicker. |
| All frames start from the "first frame latent" | Frame-by-frame inheritance accumulates drift: tested, black hair turns cyan after a few frames. Anchoring to the same first frame latent keeps face, hair color, and composition stable. |
| Keyframes use img2img (denoise 0.4 / 0.5) | Less than 1.0 means "partial redraw on the first frame based on new prompt", only changing the expression area, not the style. |
| Intermediate frames use LatentInterpolate | Interpolating in latent space is cleaner than crossfading in pixel space; no semi-transparent ghosting appears. |
| 24 frames instead of 8 | 8 frames are only enough for a loop; 24 frames @10fps = 2.4 seconds, enough for a "start → climax → release" three-part structure. |
| Triangular curve + keyframe pauses | First frame → A → B → first frame, with 2-frame holds at keyframes for a "breathing" feel to the action. |
| Save only final files | Saving every frame with SaveImage would clutter the output directory; users never need individual frames. |
1.1 How LatentInterpolate Actually Works
Source code from comfy_extras/nodes_latent.py: First, normalize each by magnitude, linearly mix, then restore magnitude using m1*ratio + m2*(1-ratio):
s1 = s1 / ||s1||; s2 = s2 / ||s2||
t = s1 * ratio + s2 * (1.0 - ratio)
t = t / ||t||
out = t * (m1 * ratio + m2 * (1.0 - ratio))
Conclusion: ratio is the weight of samples1. ratio=1.0 outputs exactly samples1, 0.0 outputs exactly samples2.
So a curve from 1.0 to 0 means moving from samples1 to samples2; within the same pair of latents, 0.08 and 0.92 mean "approaching the same keyframe from opposite ends".
2 · Workflow Structure (Node by Node)
EmptyLatent 512×512×1
│
KSampler First Frame (denoise 1.0, seed 123456789 fixed)
│
├──────────────► CLIPTextEncode A ─► KSampler A (denoise 0.4/0.5, same seed, latent=first frame)
├──────────────► CLIPTextEncode B ─► KSampler B (denoise 0.4/0.5, same seed, latent=first frame)
│
24 × LatentInterpolate (one ratio per frame)
│
24 × VAEDecode
│
ImageBatchMulti (inputcount = 24, image_1 … image_24)
├──► SaveAnimatedPNG → output\APNG\final\apng\anim24_00001_.png
├──► SaveAnimatedWEBP → output\APNG\final\webp\anim24_00001_.webp
└──► VHS_VideoCombine → output\APNG\final\gif\anim24_00001.gif
Node count: xl 61, Dit 63 (two extra loaders, rest isomorphic).
All three outputs must be connected to the same ImageBatchMulti output, otherwise frame sequences will be inconsistent across files.
2.1 24-Frame Ratio Table (Current Version, Copy Directly)
| Frame | samples1 | samples2 | ratio | Segment |
|---|---|---|---|---|
| 1 | First Frame | A | 1.0 | First Frame → A |
| 2 | First Frame | A | 0.995 | |
| 3 | First Frame | A | 0.975 | |
| 4 | First Frame | A | 0.92 | |
| 5 | First Frame | A | 0.80 | |
| 6 | First Frame | A | 0.58 | |
| 7 | First Frame | A | 0.30 | |
| 8 | First Frame | A | 0.08 | Approaching A |
| 9 | A | B | 0.92 | A → B (starts near A, forming a pause) |
| 10 | A | B | 0.80 | |
| 11 | A | B | 0.62 | |
| 12 | A | B | 0.42 | |
| 13 | A | B | 0.22 | |
| 14 | A | B | 0.09 | |
| 15 | A | B | 0.03 | |
| 16 | A | B | 0.0 | Exactly B |
| 17 | B | First Frame | 0.88 | B → First Frame (starts near B, forming a pause) |
| 18 | B | First Frame | 0.72 | |
| 19 | B | First Frame | 0.52 | |
| 20 | B | First Frame | 0.32 | |
| 21 | B | First Frame | 0.16 | |
| 22 | B | First Frame | 0.06 | |
| 23 | B | First Frame | 0.02 | |
| 24 | B | First Frame | 0.01 | Almost back to first frame, seamless loop to frame 1 |
Key points:
- No duplicate ratio within the same pair of latents. The same value across different segments is safe (different samples pairs will produce different images); a collision within the same segment would produce pixel-identical adjacent frames.
- Pauses are achieved by "approaching the same keyframe from both ends" (frame 8 at 0.08 → frame 9 at 0.92; frame 16 at 0.0 → frame 17 at 0.88), not by reducing frame count. These two instances of 0.92 / 0.0 are in different segments, so they are safe to reuse.
- The first and last frames are both near the first frame (1.0 and 0.01), so looping playback doesn't jump.
2.2 Identical Frames Will Be Dropped (Must Know)
When Pillow writes APNG, if two frames are pixel-identical, it drops the duplicate frame and adds its duration to the previous frame (PIL/PngImagePlugin.py, _write_multiple_frames, when bbox is empty: previous.encoderinfo["duration"] += ...; continue).
In tests, 24 frames were queued but only 19 were exported. This is why. Don't use duplicate ratios within the same samples1/samples2 pair; identical values across segments are safe, but the first and last frames must not be pixel-identical either.
2.3 Expanding from 3 Keyframes to K Keyframes (For Stories, No Structural Changes)
With only three segments in 24 frames, you can only do "start → one action → return". To tell a full story, increase the keyframe count from 3 to 4–5, and add segments accordingly. Each additional keyframe adds only 2 nodes (one CLIPTextEncode + KSampler pair):
| Beats | Keyframe Chain | Segments | 24-Frame Distribution |
|---|---|---|---|
| 3 | First Frame → A → B | 3 | 8 / 8 / 8 |
| 4 | First Frame → A → B → C | 4 | 6 / 7 / 6 / 5 |
| 5 | First Frame → A → B → C → D | 5 | 5 / 6 / 5 / 4 / 4 |
To add one keyframe (using xl as example; Dit is isomorphic):
- Duplicate the
CLIPTextEncode(6) andKSampler(7) pair into new nodes; theKSampler'slatent_imageshould still connect to the first frame'sVAEEncode,positiveconnects to the newCLIPTextEncode, seed set to123456792, mode stillfixed. - Split the original 8
LatentInterpolatenodes from theA→Bsegment into two groups:A→BandB→C, reconnectingsamples1/samples2accordingly. - Use
make_curve.py --segs 6,7,6,5to recalculate the 24 ratios and paste them one by one. - Don't let any single segment have fewer than 4 frames: a segment with fewer than 4 frames won't show any action, just one jump. If the number of beats increases, reduce the segment count or increase the total frame count to 30.
3 · Save Node Parameters
| Node | Parameter | xl | Dit | Notes |
|---|---|---|---|---|
| SaveAnimatedPNG | filename_prefix | APNG/final/apng/anim24 | Same | / in prefix creates subdirectories |
| fps | 10 | 10 | Each frame int(1000/fps) ms, 24 frames = 2.4s | |
| compress_level | 4 | 4 | 0–9, higher = smaller but slower | |
| SaveAnimatedWEBP | filename_prefix | APNG/final/webp/anim24 | Same | |
| fps | 10 | 10 | ||
| lossless | True | True | Set to False for smaller size | |
| quality | 90 | 90 | No effect when lossless=True | |
| method | default | default | default=4 / fastest=0 / slowest=6 | |
| VHS_VideoCombine | frame_rate | 10 | 10 | |
| loop_count | 0 | 0 | 0 = infinite loop | |
| filename_prefix | APNG/final/gif/anim24 | Same | ||
| format | image/gif | Same | ||
| pingpong | False | False | If enabled, plays forward + backward, doubling frame count | |
| save_output | True | True |
Measured output (24 frames at 512², final results from 2026-11-23):
| Environment | APNG | GIF | WebP (lossless=True) |
|---|---|---|---|
| xl | 6.61 MB | 2.41 MB | 0.80 MB |
| Dit | 4.15 MB | 2.72 MB | 2.88 MB |
Size fluctuates with scene complexity, not a fixed ratio. WebP with lossless enabled isn't always smaller than GIF; to reduce size, disable lossless and use quality 80–90.
4 · Adjusting Timing (Don't Reduce Frame Count)
Priority from top to bottom:
- Overall speed → change fps. 10 is steady, 9 is slower, 12 is snappier. 24 frames @10fps = 2.4s, @12fps = 2s.
- One segment too fast → change the proportion density of that segment. Making adjacent ratio differences smaller = slowing that segment.
- Want a pause → add frames that "stick close" to the keyframe. For example, after 0.08, add another 0.04, then switch to 0.92.
- Want more pronounced action → first increase the prompt difference between A/B, then increase denoise (xl 0.4→0.45, Dit 0.5→0.55 limit).
- Don't slow down by reducing frames. Slowing down 12 frames will just result in a slideshow.
Baseline (empirically acceptable ranges):
| Metric | Acceptable Range | Notes |
|---|---|---|
| Average pixel difference between adjacent frames | 0.3–3.0 | For xl, values around 0.4 are normal; anything above 0 is fine. |
| Total duration | 1.6–3.0 s | Stickers longer than 3s feel sluggish. |
| Pause frames | 1–2 frames per keyframe | More than that looks stuck. |
xl is currently "subtle"; for more pronounced effects, keep blush in A, add mouth open or change closed eyes to squint, and raise denoise to 0.45.
Dit currently has differences of 0.06–3.04, average 1.43—the motion amplitude is already sufficient; don't increase it further.
5 · Prompt Writing (Determines Half of Coherence)
All three positive prompts must share the same "subject lock" sentence, changing only the expression suffix:
Subject Lock (identical for all three)
masterpiece, best quality, 1girl, solo, upper body, looking at viewer, simple background
First Frame: … , neutral expression, mouth closed
Keyframe A: … , big smile, eyes half closed, blush
Keyframe B: … , laughing, mouth open, blush
Negative: worst quality, low quality, blurry, watermark, text, signature, bad anatomy, extra fingers
Rules:
- Only change 1–2 action tags. Adding
arms up,turn head,from sidewill change the composition along with the action, causing frame-to-frame discontinuity. - A and B should have a gradient: A is "slight smile", B is "big laugh, mouth open". If the two frames are too similar, no motion is visible.
- SDXL: avoid
eyes closed. Tests show the iris changes from gray-blue to cyan-green, which flickers during playback; useeyes half closedorsquint. - Moss has weaker control over expressions; word difference between A/B can be larger (
eyes closedis stable in Dit). - Keep the negative prompt fixed; don't change it per frame.
- To change characters, only modify the character description in the subject lock sentence; keep the expression words for A/B unchanged.
5.1 Ready-Made Expression Templates (A / B Ready to Replace)
| Effect | A | B | Notes |
|---|---|---|---|
| Smile → Laugh | big smile, eyes half closed | laughing, mouth open | Current default, most stable |
| Wink | one eye closed, wink | eyes closed, smile | Fewer wink frames look better |
| Surprise | surprised, mouth open, wide eyes | shocked, gasp | Large motion amplitude; reduce denoise by 0.05 |
| Shy | blush, looking away | blush, eyes closed, shy smile | Eye gaze shift is prone to drift; test with small steps first |
| Angry | pout, angry | angry, mouth open, frown | Make A softer, B more intense; SDXL may drift from looking away to looking back |
| Sad → Cry | sad, tearful eyes | crying, eyes closed, tears | Tears need extra water drop prompt to appear |
| Sleepy | sleepy, half closed eyes | yawning, mouth open, eyes closed | A uses blended eyes; B can keep face straight, don't add tilt |
| Smug | smirk, one eyebrow raised | smug, closed eyes, smirk, blushing | Single eyebrow is the hardest point; may need more retries |
| Scared | worried, eyes wide, sweat | shocked, mouth open, scream | Add sweat and streaming tear for effect; denoise can be slightly higher |
| Heart Eyes | smile, sparkle eyes | lovestruck, heart eyes, blush, hands on cheeks | heart eyes often requires specific LoRA to produce; test first |
| Nosebleed | surprised, blush | nosebleed, eyes closed, mouth open, blush | Test blood on SDXL first |
5.2 Multi-Character Workflow
Same structure as single character, three changes:
- Subject lock sentence writes all characters together:
masterpiece, best quality, 1girl and 1boy ... simple background - A/B prompts use
[tags different for each character]:[girl: big smile, eyes closed|boy: neutral, looking at girl] - Keyframes still img2img on the first frame. If one character's expression requires a large amplitude, the other character might also be affected; denoise 0.3–0.35 is sufficient for multi-character.
Moss/DiT doesn't support bracket syntax; use AND syntax:
big smile AND neutral expression, looking at viewer AND looking at girl
AND must appear paired, and the ratio will divide evenly based on the number of AND (e.g., one AND = 50/50).
6 · Workflow Files on Disk
| File | Size | Location | Source |
|---|---|---|---|
APNG-MultiFrame-SDXL.json | ~200 KB | user/default/workflows/ xl | Written from assets/workflow-sdxl.json |
APNG-MultiFrame-Moss-DiT.json | ~200 KB | user/default/workflows/ Dit | Written from assets/workflow-moss.json |
workflow-sdxl.json | ~200 KB | assets/ | Snapshot when SKILL.md was drafted |
workflow-moss.json | ~200 KB | assets/ | Snapshot when SKILL.md was drafted |
workflow-sdxl-4beat.json | ~200 KB | assets/ | 4-beat test example |
workflow-moss-4beat.json | ~200 KB | assets/ | 4-beat test example |
Two sets of parameters inside the workflow: widgets_values is internal; extra > workflow is user-visible. The scripts rebuild both when generating.
7 · Typical Issues and Solutions
| Problem | Likely Cause | Solution |
|---|---|---|
| Flicker | denoise too high | Reduce denoise by 0.05; for xl, don't exceed 0.4 |
| Color drift over several frames | Drift from frame-by-frame inheritance | Use a fixed first frame latent as the anchor |
| GIF or PNG plays only 19 frames | Pillow dropped identical adjacent frames | Check 24 ratio duplicates; ensure first and last frames differ by even one pixel |
| Moss-DiT generates lower quality than SDXL | Model inherently weaker at expressions | Use stronger prompt words; ensure A/B difference is large enough |
| VideoHelperSuite node doesn't appear | Missing plugin or whitelist | Check whitelist includes VideoHelperSuite |
| Frames display but motion is barely visible | A/B prompts too similar | Increase A/B prompt difference; keep first frame neutral |
| Save nodes output 0 KB files or fail | Output path not writable | Check output/APNG/ libre directory exists and is writable |
| Static characters but backgrounds flicker | Background denoise too high | Try denoise not exceeding 0.35; add background-related negative |
| ComfyUI process won't stop but can't occupy port | Port is held by a daemon process | Stop-Process -Id <PID> multiple times; or restart system |
ImageBatchMulti node turns red | Workflow file corrupted or plugin version mismatch | Regenerate with emit_workflow.py; manually install kjnodes latest version |
8 · 4-Beat Storyboard Example (For Direct Copy)
This example requires 4 keyframes (first frame + A + B + C), 3 segments:
8.1 Determine Storyboard: Surprise
| Keyframe | Type | Action (50 tokens total) |
|---|---|---|
| First Frame | Base | neutral expression, looking at viewer, |
| closed mouth, standing straight | ||
| A | Trigger | eyes wide, mouth slightly open, slight surprise |
| B | Height | shocked, mouth open, hands on cheeks |
| C | Return | relieved smile, eyes closed, sighing |
| Subject Lock | masterpiece, best quality, 1girl, solo, upper body, simple background |
8.2 Copy Curve Table
| Frame | samples1 | samples2 | Ratio |
|---|---|---|---|
| 1 | First Frame | A | 1.0 |
| 2 | First Frame | A | 0.99 |
| 3 | First Frame | A | 0.95 |
| 4 | First Frame | A | 0.85 |
| 5 | First Frame | A | 0.60 |
| 6 | First Frame | A | 0.25 |
| 7 | A | B | 0.98 |
| 8 | A | B | 0.88 |
| 9 | A | B | 0.62 |
| 10 | A | B | 0.35 |
| 11 | A | B | 0.10 |
| 12 | A | B | 0.02 |
| 13 | B | C | 0.98 |
| 14 | B | C | 0.88 |
| 15 | B | C | 0.62 |
| 16 | B | C | 0.35 |
| 17 | B | C | 0.10 |
| 18 | B | C | 0.02 |
| 19 | C | First Frame | 0.88 |
| 20 | C | First Frame | 0.62 |
| 21 | C | First Frame | 0.35 |
| 22 | C | First Frame | 0.10 |
| 23 | C | First Frame | 0.02 |
| 24 | C | First Frame | 0.00 |
8.3 Run Script
python scripts/emit_workflow.py --base assets/workflow-sdxl.json --story assets/story.surprise.json --out my-surprise.json
Or manually modify: 3 beats → 4 beats, paste ratio table, modify KSampler's positive.
9 · Skill Archive and Source
This skill file is generated from three archived conversations:
| Conversation | Time | Content |
|---|---|---|
| Original Build | 2026-11-22 15:35 → 11-23 00:53 | Failed batch_size approach → 8-frame same-source redraw → three-keyframe interpolation → 24 frames three formats; directory hierarchy; save only final files |
| Sequel | 2026-11-23 08:54 → 11:41 | xl closed eyes causing iris color change → eyes half closed, denoise 0.4; unified "no flicker" across both environments |
| Handoff | 2026-11-23 11:38 → 11:49 | SKILL.md draft, script commit, external info verification |
Sessions are archived in conversations/; key decisions are recorded in the table in Section 1.
Appendix A · Environment Detection Script Details
detect_env.py main functionality:
- Find ComfyUI root directory (search system drive / user-defined path)
- Detect Python interpreter path
- Read version files (ComfyUI version, Python version, PyTorch version)
- List all installed checkpoints (search
checkpoints/,diffusion_models/,text_encoders/,vae/) - List all installed custom nodes (search
custom_nodes/) - Detect available port range (8188–8199)
- Identify available workflows (search
user/default/workflows/) - Write all results to
profiles/<environment>.json
Usage: python scripts/detect_env.py --search D:\
Appendix B · Skill File Update Log
| Date | Version | Changes |
|---|---|---|
| 2026-11-23 | 1.0 | Initial draft, three conversations merged, scripts finalized |
| 2026-11-24 | 1.1 | New default denoise 0.35 + curve adjustments, color drift data added |
Generated from AI transcript; some paths and environment configurations may differ based on the user's local setup. Always run
detect_env.pybefore first use on a new machine.