Collections
ComfyUI and generative AI
If you generate thousands of images or video clips per project in ComfyUI, the Zegami Batch Export node sends every output — plus its full workflow graph — straight into a Zegami collection, where you can filter by parameter, sort by similarity, and publish the best as a shareable gallery.
Last updated 2026-06-03
Why connect ComfyUI to Zegami
Generative-AI workflows produce batches, not single images — thousands of variations across seeds, samplers, CFG values, checkpoints, and prompts. Folder-scrolling doesn’t scale. With Zegami you get a visual grid of every output, filter and sort by any generation parameter, cluster by visual similarity (UMAP) to spot duplicates and outliers, and share a public link as the deliverable.
The integration has two halves:
- The Zegami Batch Export ComfyUI node (open-source, MIT) that captures and uploads each generation.
- The Zegami side: a collection-scoped API key, and the Calculated Columns → From JSON path tool that turns the captured workflow graph into filterable columns.
1. Create a target collection and a scoped key
- Create a collection in Zegami (empty is fine — the node will fill it).
- Open the collection’s Settings → API access tab.
- Click Generate ComfyUI key. The key is scoped to this collection only — it can’t touch the rest of your account, so it’s safe to keep in a shared workflow file. Copy it now; it’s shown only once.
A scoped key is the recommended choice for ComfyUI. (You can also mint account-wide keys under Account → API keys, but those grant access to every collection you can reach.)
2. Install and configure the node
Install ComfyUI-Zegami from ComfyUI Manager (search “Zegami”), or clone
github.com/zegami/comfyui-zegami into ComfyUI/custom_nodes. Video export also
needs ffmpeg on your PATH.
Provide your key in priority order (the node never reads it from the workflow JSON, so shared workflows stay credential-free):
ZEGAMI_API_KEYenvironment variable (recommended)~/.zegami/config.json:{ "api_key": "zeg_…" }- the node’s
api_key_overrideinput
3. Wire up and queue
Drop the Zegami Batch Export node inline anywhere — it passes images
through, so it can sit before a Save node.
- Connect your decoded images to the
imagesinput (the primary path: each item in the batch becomes a separate collection item). - For generative video (Wan / Hunyuan / LTX / Mochi), connect frames to the
videoinput; the node encodes an MP4 and a poster thumbnail. - Set
collection_idto your collection’s id. - Optionally set
tags(e.g. a campaign or client name) andnotes.
Queue the prompt. Switch to Zegami and your generations appear in the grid as the pipeline processes them. The node uploads on a background queue and never slows or breaks a generation — if Zegami is unreachable, your images are still saved locally.
4. Turn the workflow graph into columns
Every output carries its full ComfyUI prompt graph as an opaque
_comfy_json field. To make parameters filterable:
- Open the collection, go to the views panel and Add calculated column.
- Switch to the From JSON path mode.
- Use the Suggested columns chips — Zegami auto-detects common nodes (KSampler, LoraLoader, CheckpointLoaderSimple, CLIPTextEncode) and offers one-click columns for seed, steps, cfg, sampler, scheduler, model, lora, and the positive/negative prompts.
- Or extract any field by hand: pick the
_comfy_jsonsource column, enter a JSON path (e.g.$.prompt.6.inputs.seed), choose a type, and preview.
The columns persist with the collection, so they re-apply every time it loads. Now you can filter by sampler, sort by CFG, group by checkpoint, or build a scatter plot of seed vs. any metric.
5. Triage, compare, and publish
- Filter by any extracted parameter to narrow thousands of outputs to the handful worth keeping (Filtering & search).
- Similarity / UMAP surfaces near-duplicates and structural clusters — invaluable for auditing a LoRA or checkpoint training set.
- Video items show a play badge and duration in the grid; hover to preview (where supported), and open the inspector for full playback.
- Publish the curated view as a public, shareable collection (Sharing & publishing) — the gallery itself becomes the client deliverable.
Plan limits
There’s no hard per-collection item cap — your plan’s storage is the real ceiling (shown on Organisation → Plan, with a rough “≈ N images / N video clips” estimate). A studio pushing 10k+ video items should keep an eye on it; Team plans add metered storage beyond the included quota.