Communitygithub.com

comfyui-apng-motion

A complete method for generating 24-frame coherent APNG/WebP/GIF animations (e.g., stickers) in ComfyUI using a first frame plus latent interpolation between two keyframes. Covers dual environment setup (SDXL / Moss-DiT), workflow structure, 24-frame curves, prompt writing, output conventions for only final files, sticker parameters, compatibility, and troubleshooting.

What is comfyui-apng-motion?

This skill provides a complete, reliable workflow for creating smooth, 24-frame animated stickers (APNG/WebP/GIF) directly within ComfyUI, eliminating the need for external scripts or intermediate file saving. It is built on a core principle: generating three keyframes (neutral → A → B) from the same base latent, then using 24 LatentInterpolate nodes to create smooth transitions, all processed via a single Queue. The skill explicitly supports two different environments, SDXL and Moss-DiT, providing configuration tables, model names, and workflow file paths for each. It also includes a suite of Python scripts for environment detection, workflow validation (e.g., `doctor.py`, `check_anim.py`), and automatic generation of multi-beat stories, making it portable and suitable for both sticker creation and longer narrative sequences. The detailed documentation addresses common problems like frame flicker, color drift, and file corruption, offering specific solutions such as denoising limits, curve adjustments, and prompt locking.

Works with✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/Gg22333/comfyui-apng-motion/tree/HEAD

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

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

Itemxl EnvironmentDit Environment
ComfyUI RootD:\ComfyUI-aki-v3.2-xl\ComfyUID:\ComfyUI-aki-v3.2-Dit\ComfyUI
PythonD:\ComfyUI-aki-v3.2-xl\python\python.exeD:\ComfyUI-aki-v3.2-Dit\python\python.exe
VersionComfyUI 0.46.2 / torch 2.13.0+cu130ComfyUI 0.46.0 / torch 2.13.0+cu132
CommonPython 3.13.11 / Pillow 12.1.0 / RTX 5070 Ti Laptop 12GBSame as left

The table below is a local instance, not a specification. When switching machines, run python scripts/detect_env.py first. Paths, ports, model names, and versions are all stored in profiles/*.json; the D:\... 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)

VersionEnvironmentAdjacent Frame DifferenceColor DriftConclusion
New (denoise 0.35 + linear + global action)xl0.12 – 2.35, avg 1.082.63Current default, no flicker
Old (denoise 0.55 + power curve)xl0.95 – 5.42, avg 2.343.07Color banding in mid-section, deprecated
HistoricalDit0.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

  1. First, read the online workflow file (user/default/workflows/APNG-MultiFrame-*.json); the files in assets/ are snapshots taken at the time of capture—the user may have modified them.
  2. Any changes must be applied to both environments simultaneously: xl and Dit share the same node structure, only loaders, sampling parameters, and denoise differ.
  3. After making changes, have the user refresh the browser page before Queuing; otherwise, the frontend still holds the old nodes and prefixes.
  4. 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.ini are already set to network_mode = offline, security_level = normal. No more FETCH ComfyRegistry Data or Cannot connect to raw.githubusercontent.com on startup. The remaining WinError 10022 comes 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>, then netstat -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)

SessionTimeContribution
Original Build2026-11-22 15:35 → 11-23 00:53batch_size failure → 8-frame same-source redraw → three keyframe interpolation → 24 frames, three formats; directory structure; save only final files
Sequel2026-11-23 08:54 → 11:41xl closed eyes causing iris color change → eyes half closed, denoise 0.4; unified "no flicker" across both environments
Handoff2026-11-23 11:38 → 11:49SKILL.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 FamilyLoaderKeyframe denoise
SD 1.5CheckpointLoaderSimple0.45–0.55
SDXL / Illustrious / NoobAICheckpointLoaderSimple0.35–0.45
FLUX.1UNETLoader + DualCLIPLoader + VAELoader0.45–0.55 (add FluxGuidance before)
Moss / DiTUNETLoader + CLIPLoader (type=moss_image) + VAELoader0.50–0.55

0.5.1 What You Can Change in the Workflow

Each generated workflow has these three layers; open and adjust:

ScopeNodeWhat to Change
Whole clipCLIPTextEncode "Global Action Guide (shared by all keyframes)"Action, camera, lighting, style; change one place, all keyframes apply
Per frameCLIPTextEncode "K0 / K1 / … prompt"Expression, pose, gaze
Per frame samplingEach KSamplerseed, steps, cfg, sampler, scheduler, denoise
Timing24 LatentInterpolate ratioslinear most uniform, ease slow at both ends, snap old behavior
Speedfps of three save nodesAll three must match (10fps × 24 = 2.4 seconds)
QualityAPNG compress_level, WebP lossless/quality, VHS loop/pingpongSize 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

ScriptPurposeDependencies
detect_env.pyScan local ComfyUI: version, Python, model list, plugins, running ports, available workflows → profiles/*.jsonNone
doctor.pyCheck against profile: files, models, plugins, node types, output dir writable, port aliveNone (port check requires network)
emit_workflow.py3 keyframes → K beats (3–5); compile story card prompts; recalculate curves; validate connections; optional --run to generate directlyNone
check_anim.pyFrame count, duration, loop, adjacent frame difference, duplicate frames, color driftPillow
make_curve.pyOutput ratio curves alone, for timing adjustmentsNone
make_preview.pyRe-encode final APNG to web preview: global palette + dithered GIF, true-color WebPPillow
comfy_lib.pyShared library: profile, HTTP, curves, UI→API conversionNone

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
DependencyVersionRequiredConsequences if Missing
Python≥ 3.9YesScripts won't run
Pillow≥ 9.0Validation onlycheck_anim.py unavailable; output generation unaffected
ComfyUI≥ 0.3 (with SaveAnimatedPNG / SaveAnimatedWEBP)YesSave nodes don't exist
comfyui-kjnodesAnyYesImageBatchMulti turns red
ComfyUI-VideoHelperSuiteAnyNoOnly GIF missing; APNG/WebP work fine
curlAnyNoHTTP 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:

FormCommandUse Case
Directory copypython scripts/install.py --dest <skills directory>Multiple local installs (Codex / magpie)
Zip archivepython scripts/package.py → dist/comfyui-apng-motion-<ver>.zip + .sha256Offline distribution, sharing
Git repositoryJust 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:

PathWho Reads It
~/.codex/skills/comfyui-apng-motionCodex native skills
~/.config/magpie/library/skills/comfyui-apng-motionmagpie 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)

PracticeReason
Don't use batch_size=24batch_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 LatentInterpolateInterpolating in latent space is cleaner than crossfading in pixel space; no semi-transparent ghosting appears.
24 frames instead of 88 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 pausesFirst frame → A → B → first frame, with 2-frame holds at keyframes for a "breathing" feel to the action.
Save only final filesSaving 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)

Framesamples1samples2ratioSegment
1First FrameA1.0First Frame → A
2First FrameA0.995
3First FrameA0.975
4First FrameA0.92
5First FrameA0.80
6First FrameA0.58
7First FrameA0.30
8First FrameA0.08Approaching A
9AB0.92A → B (starts near A, forming a pause)
10AB0.80
11AB0.62
12AB0.42
13AB0.22
14AB0.09
15AB0.03
16AB0.0Exactly B
17BFirst Frame0.88B → First Frame (starts near B, forming a pause)
18BFirst Frame0.72
19BFirst Frame0.52
20BFirst Frame0.32
21BFirst Frame0.16
22BFirst Frame0.06
23BFirst Frame0.02
24BFirst Frame0.01Almost back to first frame, seamless loop to frame 1

Key points:

  1. 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.
  2. 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.
  3. 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):

BeatsKeyframe ChainSegments24-Frame Distribution
3First Frame → A → B38 / 8 / 8
4First Frame → A → B → C46 / 7 / 6 / 5
5First Frame → A → B → C → D55 / 6 / 5 / 4 / 4

To add one keyframe (using xl as example; Dit is isomorphic):

  1. Duplicate the CLIPTextEncode(6) and KSampler(7) pair into new nodes; the KSampler's latent_image should still connect to the first frame's VAEEncode, positive connects to the new CLIPTextEncode, seed set to 123456792, mode still fixed.
  2. Split the original 8 LatentInterpolate nodes from the A→B segment into two groups: A→B and B→C, reconnecting samples1 / samples2 accordingly.
  3. Use make_curve.py --segs 6,7,6,5 to recalculate the 24 ratios and paste them one by one.
  4. 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

NodeParameterxlDitNotes
SaveAnimatedPNGfilename_prefixAPNG/final/apng/anim24Same/ in prefix creates subdirectories
fps1010Each frame int(1000/fps) ms, 24 frames = 2.4s
compress_level440–9, higher = smaller but slower
SaveAnimatedWEBPfilename_prefixAPNG/final/webp/anim24Same
fps1010
losslessTrueTrueSet to False for smaller size
quality9090No effect when lossless=True
methoddefaultdefaultdefault=4 / fastest=0 / slowest=6
VHS_VideoCombineframe_rate1010
loop_count000 = infinite loop
filename_prefixAPNG/final/gif/anim24Same
formatimage/gifSame
pingpongFalseFalseIf enabled, plays forward + backward, doubling frame count
save_outputTrueTrue

Measured output (24 frames at 512², final results from 2026-11-23):

EnvironmentAPNGGIFWebP (lossless=True)
xl6.61 MB2.41 MB0.80 MB
Dit4.15 MB2.72 MB2.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:

  1. Overall speed → change fps. 10 is steady, 9 is slower, 12 is snappier. 24 frames @10fps = 2.4s, @12fps = 2s.
  2. One segment too fast → change the proportion density of that segment. Making adjacent ratio differences smaller = slowing that segment.
  3. 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.
  4. 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).
  5. Don't slow down by reducing frames. Slowing down 12 frames will just result in a slideshow.

Baseline (empirically acceptable ranges):

MetricAcceptable RangeNotes
Average pixel difference between adjacent frames0.3–3.0For xl, values around 0.4 are normal; anything above 0 is fine.
Total duration1.6–3.0 sStickers longer than 3s feel sluggish.
Pause frames1–2 frames per keyframeMore 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:

  1. Only change 1–2 action tags. Adding arms up, turn head, from side will change the composition along with the action, causing frame-to-frame discontinuity.
  2. 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.
  3. SDXL: avoid eyes closed. Tests show the iris changes from gray-blue to cyan-green, which flickers during playback; use eyes half closed or squint.
  4. Moss has weaker control over expressions; word difference between A/B can be larger (eyes closed is stable in Dit).
  5. Keep the negative prompt fixed; don't change it per frame.
  6. 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)

EffectABNotes
Smile → Laughbig smile, eyes half closedlaughing, mouth openCurrent default, most stable
Winkone eye closed, winkeyes closed, smileFewer wink frames look better
Surprisesurprised, mouth open, wide eyesshocked, gaspLarge motion amplitude; reduce denoise by 0.05
Shyblush, looking awayblush, eyes closed, shy smileEye gaze shift is prone to drift; test with small steps first
Angrypout, angryangry, mouth open, frownMake A softer, B more intense; SDXL may drift from looking away to looking back
Sad → Crysad, tearful eyescrying, eyes closed, tearsTears need extra water drop prompt to appear
Sleepysleepy, half closed eyesyawning, mouth open, eyes closedA uses blended eyes; B can keep face straight, don't add tilt
Smugsmirk, one eyebrow raisedsmug, closed eyes, smirk, blushingSingle eyebrow is the hardest point; may need more retries
Scaredworried, eyes wide, sweatshocked, mouth open, screamAdd sweat and streaming tear for effect; denoise can be slightly higher
Heart Eyessmile, sparkle eyeslovestruck, heart eyes, blush, hands on cheeksheart eyes often requires specific LoRA to produce; test first
Nosebleedsurprised, blushnosebleed, eyes closed, mouth open, blushTest blood on SDXL first

5.2 Multi-Character Workflow

Same structure as single character, three changes:

  1. Subject lock sentence writes all characters together: masterpiece, best quality, 1girl and 1boy ... simple background
  2. A/B prompts use [tags different for each character]: [girl: big smile, eyes closed|boy: neutral, looking at girl]
  3. 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

FileSizeLocationSource
APNG-MultiFrame-SDXL.json~200 KBuser/default/workflows/ xlWritten from assets/workflow-sdxl.json
APNG-MultiFrame-Moss-DiT.json~200 KBuser/default/workflows/ DitWritten from assets/workflow-moss.json
workflow-sdxl.json~200 KBassets/Snapshot when SKILL.md was drafted
workflow-moss.json~200 KBassets/Snapshot when SKILL.md was drafted
workflow-sdxl-4beat.json~200 KBassets/4-beat test example
workflow-moss-4beat.json~200 KBassets/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

ProblemLikely CauseSolution
Flickerdenoise too highReduce denoise by 0.05; for xl, don't exceed 0.4
Color drift over several framesDrift from frame-by-frame inheritanceUse a fixed first frame latent as the anchor
GIF or PNG plays only 19 framesPillow dropped identical adjacent framesCheck 24 ratio duplicates; ensure first and last frames differ by even one pixel
Moss-DiT generates lower quality than SDXLModel inherently weaker at expressionsUse stronger prompt words; ensure A/B difference is large enough
VideoHelperSuite node doesn't appearMissing plugin or whitelistCheck whitelist includes VideoHelperSuite
Frames display but motion is barely visibleA/B prompts too similarIncrease A/B prompt difference; keep first frame neutral
Save nodes output 0 KB files or failOutput path not writableCheck output/APNG/ libre directory exists and is writable
Static characters but backgrounds flickerBackground denoise too highTry denoise not exceeding 0.35; add background-related negative
ComfyUI process won't stop but can't occupy portPort is held by a daemon processStop-Process -Id <PID> multiple times; or restart system
ImageBatchMulti node turns redWorkflow file corrupted or plugin version mismatchRegenerate 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

KeyframeTypeAction (50 tokens total)
First FrameBaseneutral expression, looking at viewer,
closed mouth, standing straight
ATriggereyes wide, mouth slightly open, slight surprise
BHeightshocked, mouth open, hands on cheeks
CReturnrelieved smile, eyes closed, sighing
Subject Lockmasterpiece, best quality, 1girl, solo, upper body, simple background

8.2 Copy Curve Table

Framesamples1samples2Ratio
1First FrameA1.0
2First FrameA0.99
3First FrameA0.95
4First FrameA0.85
5First FrameA0.60
6First FrameA0.25
7AB0.98
8AB0.88
9AB0.62
10AB0.35
11AB0.10
12AB0.02
13BC0.98
14BC0.88
15BC0.62
16BC0.35
17BC0.10
18BC0.02
19CFirst Frame0.88
20CFirst Frame0.62
21CFirst Frame0.35
22CFirst Frame0.10
23CFirst Frame0.02
24CFirst Frame0.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:

ConversationTimeContent
Original Build2026-11-22 15:35 → 11-23 00:53Failed batch_size approach → 8-frame same-source redraw → three-keyframe interpolation → 24 frames three formats; directory hierarchy; save only final files
Sequel2026-11-23 08:54 → 11:41xl closed eyes causing iris color change → eyes half closed, denoise 0.4; unified "no flicker" across both environments
Handoff2026-11-23 11:38 → 11:49SKILL.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:

  1. Find ComfyUI root directory (search system drive / user-defined path)
  2. Detect Python interpreter path
  3. Read version files (ComfyUI version, Python version, PyTorch version)
  4. List all installed checkpoints (search checkpoints/, diffusion_models/, text_encoders/, vae/)
  5. List all installed custom nodes (search custom_nodes/)
  6. Detect available port range (8188–8199)
  7. Identify available workflows (search user/default/workflows/)
  8. Write all results to profiles/<environment>.json

Usage: python scripts/detect_env.py --search D:\

Appendix B · Skill File Update Log

DateVersionChanges
2026-11-231.0Initial draft, three conversations merged, scripts finalized
2026-11-241.1New 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.py before first use on a new machine.

Related Skills