Nodes//Nougan GIF Maker 🎞️
ComfyUI Node

Nougan GIF Maker 🎞️

GIFs that don't look like mud β€” two-pass palette, and where Discord's 10MB bites

By WinnouganΒ·Created 3 months agoΒ·Updated about 16 hours agoΒ· 10
Nougan GIF Maker 🎞️
  • video
  • images
  • frames
  • file_path
β—„start_sec0.00β–Ί
β—„end_sec5.00β–Ί
β—„width480β–Ί
β—„fps15β–Ί
β—„formatgifβ–Ί
β—„max_colors256β–Ί
β—„dithersierra2_4aβ–Ί
β—„quality75β–Ί
β—„loop_count0β–Ί
β—„speed1.00β–Ί
β—„crop_x0.000β–Ί
β—„crop_y0.000β–Ί
β—„crop_w1.000β–Ί
β—„crop_h1.000β–Ί
β—„filename_prefixnougan_gifβ–Ί
β—„export_on_runfalseβ–Ί
β—„images_fps24.0β–Ί

Every ComfyUI video workflow ends the same way: you have a beautiful five-second clip and no way to post it anywhere that isn't YouTube. Nougan GIF Maker 🎞️ is the "get it into Discord" node - trim, crop, colour-reduce and export a GIF, an animated WebP or a silent MP4, from a VIDEO or an IMAGE batch, without leaving the graph.

The part that makes it worth using

Most "video to GIF" implementations run ffmpeg once and accept the muddy result, because a naive GIF palette has 256 colours chosen by whoever wrote the encoder in 1989. This node does the proper two-pass dance: palettegen builds the best 256 colours for your clip, then paletteuse maps every frame to that palette. On gradients and skin tones the difference isn't subtle. Switch dither from sierra2_4a (nice gradients) to bayer (smallest files) and you've got the two settings that cover most cases.

The other half is the editor. Queue once and the clip loads into a real timeline: thumbnail filmstrip, draggable start/end handles, a playhead, loop preview at your chosen speed, and crop handles you drag on the video itself with optional locked ratios (1:1, 16:9, 9:16, 4:3, 3:4). Trimming a clip by typing start_sec: 1.4 into a widget is exactly the kind of thing nobody wants to do twice.

The settings that matter

format - gif (works everywhere, biggest), webp (much smaller, sharper, Discord and browsers), mp4 (what WhatsApp and Telegram actually want; they treat short silent MP4s as GIFs).

width (480 default) and fps (15) are the two biggest size levers, and the node never upscales past the cropped size. max_colors and dither apply to GIF only; quality applies to WebP/MP4. loop_count - 0 loops forever, -1 plays once. speed (0.25–4.0) changes playback rate, so 2.0 makes the clip twice as fast without re-encoding your source.

export_on_run is the one to notice. Off by default, because the ⬇ Export button works independently of the workflow - you queue once, then export as many variations as you like from the UI. Turn it on when you're batching and want a file written every run.

Outputs

frames (IMAGE) - the trimmed, cropped, resized clip as an image batch, matching the export's fps and speed, capped at 600 frames. That cap only applies to the output; the exported file isn't limited. file_path (STRING) - the file written this run. Empty unless export_on_run is on, because exports from the button aren't part of the run.

The size problem, honestly

There's a live size readout that goes orange near 8MB and red past 10MB - Discord's limit. It's an estimate: the node encodes about a second from the middle of your range and extrapolates. Ranges of roughly a second or less are exact; long clips with a lot of scene change can land off. So it's a guide, not a guarantee.

When you need to get under a limit, in order of how much it helps: shorten the clip (size scales almost linearly with length), drop width (480 β†’ 360 roughly halves pixel count), drop fps (15 β†’ 12 saves about 20%), cut max_colors to 128 or 64 with bayer dithering, switch to WebP or MP4, or crop in on the subject.

Install

The node ships with the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Winnougan/Nougan_Nodes
# restart ComfyUI

Or search Nougan in ComfyUI Manager. But the real dependency is ffmpeg: either a system binary on your PATH, or

pip install imageio-ffmpeg

in your ComfyUI environment. Most video-node users already have one of the two. Hard-refresh the browser after restarting - the timeline editor is a custom JS bundle, and a cached one gets you a node with no editor.

Where people get burned

"ffmpeg not found". Install it, or imageio-ffmpeg. Error message is explicit, which is more than most nodes manage.

"Preview expired" after a restart. ComfyUI clears its temp folder on boot; the editor's 720px proxy lived there. Queue again. Exports always read the original source, never the proxy, so quality was never at risk.

Only five seconds exported. That's the default end_sec. Drag the handle, or set end_sec to 0 for "to the end of the video".

WebP export fails. Your ffmpeg lacks libwebp_anim. Use GIF/MP4 or install a fuller build.

Frames output is short. The 600-frame cap, again - it doesn't apply to the file you exported.

Both inputs connected. video wins over images, and images_fps is ignored when a video is present. If your frames path looks wrong, check what's plugged in.

CategoryNougan

Inputs (19)

NameTypeDefaultDescription
start_secFLOAT0.000–36000Clip start in seconds (drag the handles in the editor).
end_secFLOAT5.000–36000Clip end in seconds. 0 or less than start = to the end of the video.
widthINT48016–3840Output width in px. Height follows the crop's aspect ratio.
fpsINT151–60β€”
formatCOMBOgifgif = universal. webp = way smaller. mp4 = what WhatsApp/Telegram really want.
max_colorsINT2562–256GIF palette size.
ditherCOMBOsierra2_4aGIF only. bayer = smallest files.
qualityINT751–100WebP / MP4 only.
loop_countINT0-1–10000 = loop forever, -1 = play once (GIF).
speedFLOAT1.000.25–4β€”
crop_xFLOAT0.0000–1β€”
crop_yFLOAT0.0000–1β€”
crop_wFLOAT1.0000.02–1β€”
crop_hFLOAT1.0000.02–1β€”
filename_prefixSTRINGnougan_gifβ€”
export_on_runBOOLEANfalseAlso write the file every time the workflow runs.
videooptVIDEOβ€”
imagesoptIMAGEβ€”
images_fpsoptFLOAT24.01–120Frame rate of the IMAGE batch (ignored for VIDEO).

Outputs (2)

NameTypeDescription
framesIMAGEβ€”
file_pathSTRINGβ€”