Extensions/😸 YFG Comical Nodes
ComfyUI Extension

😸 YFG Comical Nodes

Utility custom nodes for special effects, image manipulation and quality of life tools.

By gonzaluΒ·Created 2 years agoΒ·Updated about 14 hours agoΒ· 29
gonzalu/ComfyUI_YFG_Comical
Nodes26
On cloudLocal install
Category🐯 YFG/πŸ”€ Switchers, 🐯 YFG
Stars29
Updatedabout 14 hours ago

Nodes (26)

🐯 YFG 10 Image Switcher

A whole seed row on one dropdown

🐯 YFG/πŸ”€ Switchers
🐯 YFG 15 Image Switcher

15 images, one dropdown, and a diagram that shows the active path

🐯 YFG/πŸ”€ Switchers
🐯 YFG 20 Image Switcher

The top end of the YFG switcher family

🐯 YFG/πŸ”€ Switchers
🐯 YFG Image To Contrast Mask

Turn an image into a contrast mask for inpainting or compositing

🐯 YFG
🐯 YFG Image to imgBB

Upload a render to imgBB and get a shareable URL, straight from the graph

🐯 YFG/πŸ”„ Loaders
🐯 YFG 3 Image Switcher

A 3-way image switch with a routing diagram, so you can see what you picked

🐯 YFG/πŸ”€ Switchers
🐯 YFG 5 Image Switcher

A 5-way image switch that tells you which slot is live

🐯 YFG/πŸ”€ Switchers
🐯 YFG Image Halftone Generator

Turn a photo into a halftone, CMYK screen angles included

🐯 YFG
🐯 YFG Histograms Generator

See the tonal range before you judge the render

🐯 YFG
🐯 YFG Histograms Generator (compact)

One histogram, two outputs, zero clutter β€” the compact analyzer

🐯 YFG
🐯 YFG Image Side by Side

A before/after node that labels itself, so you actually know which side is which

🐯 YFG
🐯 YFG imgBB to Image

Load any image from a URL β€” or a base64 string, or a local path

🐯 YFG/πŸ”„ Loaders
🐯 YFG Monochrome Image Clip

Six threshold modes, three channels β€” the swiss-army monochrome clipper

🐯 YFG
🐯 YFG PixelArt

The two-line resize that turns renders into pixel art

🐯 YFG
🐯 YFG Random Image From Directory

The folder-aware random image picker with a built-in file browser

🐯 YFG/πŸ–ΌοΈ Loaders
🐯 YFG Random.org True Random Number

True randomness from atmospheric noise β€” the version that keeps your key in the graph

🐯 YFG/πŸ”’ Numbers
🐯 YFG Random.org True Random Number (V2)

True random numbers without ever typing your key into the graph

🐯 YFG/πŸ”’ Numbers
🐯 YFG Smart Checkpoint Loader

The checkpoint loader that flattens your folder chaos

🐯 YFG/πŸ”„ Loaders
🐯 YFG Store URL

The workflow-persistence trick

🐯 YFG/πŸ”„ Loaders
🐯 YFG Text Mask Overlay

Stamp text onto a mask β€” the node for watermarks and annotations

🐯 YFG
🐯 YFG VAE Decode with Preview

See your render without wiring a second node

🐯 YFG
🐯 YFG CivitAI MetaSave

The save node that speaks A1111 so CivitAI can read it

🐯 YFG/πŸ’Ύ Save
🐯 YFG CivitAI MetaSave V2

Your CivitAI uploads keep showing 'no resources used'? This node fixes that.

🐯 YFG/πŸ’Ύ Save
🐯 YFG Display Value

A monitor node that lives in the title bar

🐯 YFG
🐯 YFG Random Prompt From File

Random prompts from a .txt, with your negative strings intact

🐯 YFG/πŸ“ Prompts
🐯 YFG Text Concat Swap

Stop rewiring StringConcatenate every time β€” flip your prompt order with one click.

🐯 YFG/πŸ”€ Switchers
Readme
<p align="center"> <img src="img/lion-face.svg" width="200"> </p> <div align="center">

YFG Comical ComfyUI Custom Nodes

</div>

A collection of ComfyUI utility custom nodes. These provide functionality not offered in the core app or other custom nodes. Several nodes enhance existing ideas with improved UX and quality-of-life features.


<small><i><a href="http://ecotrust-canada.github.io/markdown-toc/">Table of contents generated with markdown-toc</a></i></small>


Nodes

Image Histograms Generator

Image Histograms Generator

Calculate image histograms for RGB channels and L (luminance); displays a graphical representation.

Image Histograms Generator (compact)

Image Histograms Generator (compact)

Reduces outputs to just two: Original and Histogram. Can self-preview (original or histogram) and forward the selected histogram downstream.

Image Halftone Generator

Image Halftone Generator

Based on original code by Phil Gyford and ComfyUI node by aimingfail.

Generates halftone from an input image; can self-display or send output to other nodes.

Image Side by Side

Image Side-by-Side Generator

Creates a side-by-side or split image from two inputs. Optional self-preview, headers (font/size/color), and label toggles.

Example (side-by-side instead of split):

Image Side-by-Side Generator

Image to imgBB

Image to imgBB

Upload and download images to/from imgBB. Includes nodes for downloading images and a URL "storage" node that keeps the original link alongside the workflow.

Setup

Create imgbb_api_key.json under ./loaders/:

{
  "api_key": "YOUR_API_KEY_HERE"
}

Obtain a key at https://api.imgbb.com/.

Smart Checkpoint Loader

Smart Checkpoint Loader

Drop-in replacement for the core "Load Checkpoint," but flattens complex directory trees so checkpoints appear as if in a single folder β€” ideal for sharing workflows.

Mono Clip

Mono Clip

Produces B/W or grayscale clipped images with three modes (each reversible). Useful for masks and stylization.

Based on original code by XSS.

VAE Decode with Preview

VAE Decode w/ Preview

VAE decode with inline preview and QoL options.

Based on original code by XSS.

Image to Contrast Mask

Image to Contrast Mask

Creates a grayscale contrast mask. Select low/high thresholds (1–255), optional blur.

Based on original code by XSS.

PixelArt

PixelArt

Generates pixel-art style images. Choose interpolation and pixel size.

Based on original Mosaic code by XSS.

Text Mask Overlay

Text Mask Overlay

Enhances the idea by Yuigahama Yui:

  • Choose fonts from System, User, or local ./fonts/ directory.
  • Built-in Mask-to-Image conversion (no extra converter needed).

Example

| <a href="img/textMaskOverlay01original.png"><img src="img/textMaskOverlay01original.png" alt="Text Mask Overlay Example" width="400"/></a> | <a href="img/textMaskOverlay01.png"><img src="img/textMaskOverlay01.png" alt="Text Mask Overlay Example" width="400"/></a> | | :-: | :-: | | Original | Output |

Example workflow JSON (also embedded in the image below):

Text Mask Overlay

Based on the ComfyUI-Text node by Yuigahama Yui.

Image Switchers

switchers

Multi-input image switchers (3, 5, 10, 15, 20 inputs). Provide a routing matrix, inline preview, and graceful handling of missing inputs (with user warnings). Designed to avoid "ganged" switcher confusion in complex workflows.

switchers switchers switchers

Random.org True Random Number

random-number

Modified version of the WAS node (original wasn't functioning). Requires a Random.org account and API key.

Based on original code by WASasquatch.


Random.org True Random Number (V2)

random-number-v2

Integrates with the random.org JSON-RPC API to generate true random numbers from atmospheric noise.

✨ Features

  • Secure API key handling
    Key is not exposed in UI, workflow JSON, or image metadata. Loaded at runtime from:

    1. Environment variable RANDOM_ORG_API_KEY, or
    2. Local JSON file random_org_api_key.json next to RandomOrgV2.py.
  • Flexible outputs
    Emits three types for broad node compatibility:

    • NUMBER
    • FLOAT
    • INT
  • Optional uniqueness filtering (in-memory)
    Avoid repeats within a Python session:

    • ensure_unique β€” toggle de-duplication
    • unique_scope β€” "range" (per [min, max]) or "global" (across all ranges)
    • history_size β€” how many values to remember
    • time_window_sec β€” ignore duplicates older than this window
    • retry_limit β€” extra draws to try before giving up
  • Backwards compatible
    Old node remains available as RandomOrgTrueRandomNumber_node.
    New node is RandomOrgV2TrueRandomNumber_node.

πŸ”‘ API Key Setup

  1. Create random_org_api_key.json next to RandomOrgV2.py:

    {
      "api_key": "YOUR_API_KEY_HERE"
    }
    
  2. Or set an environment variable before launching ComfyUI:

    export RANDOM_ORG_API_KEY=YOUR_API_KEY_HERE
    

    On Windows (PowerShell):

    setx RANDOM_ORG_API_KEY "YOUR_API_KEY_HERE"
    

βš™οΈ Example Usage

  • Generate a random integer between 1 and 100

    • minimum = 1
    • maximum = 100
    • mode = random
  • Ensure no repeats in the current range

    • Enable ensure_unique
    • Set unique_scope = range
    • Adjust history_size and time_window_sec

πŸ“Œ Notes

  • Session-lifetime uniqueness resets when Python restarts.
  • Persistence (disk-based history) may be added in a future version.
  • API limits: Random.org quotas apply β€” check your dashboard.

Random Image From Directory

Random Image From Directory

This node selects a single image from a given directory (with optional recursion into subdirectories).
It supports true randomness (via Random.org integration if configured) or deterministic selection by index/filename.
It also tracks previously selected images so you can compare "current" vs "previous" outputs.

✨ Features

  • Built-in directory browser
    • πŸ“ Browse for Directory button opens a navigable server-side folder picker β€” no need to type paths manually.
    • πŸ• Recent Directories button shows an MRU list of previously used directories for quick re-selection.
    • Used directories are saved automatically to yfg_dir_history.json on each run.
  • Inline output value display
    • Key output values (index_current, width, height, total_count, index_previous) are shown directly on the output slots after each run β€” no external display nodes needed.
    • Random Image From Directory Inline Display
  • Directory traversal
    • Select only from the top folder, or include all subdirectories.
  • Multiple selection modes
    • random: choose a random image (true random if Random.org is enabled, otherwise local PRNG).
    • by_index: pick image by numeric index (clamped to valid range β€” no wrap-around).
    • by_filename: select a file by exact name or substring.
    • by_query: glob-style matching (*.png, cat*, etc.), random among matches.
  • Uniqueness filtering
    • Avoids repeating the same file within the same session.
    • Scope can be per-directory or global.
    • Adjustable history_size and time_window_sec for fine control.
  • Metadata outputs
    • Current/previous file info, image size, and SHA256 hash of the file.
    • Also reports total_count = number of eligible images found.

πŸ”§ Input Parameters

  • image_directory (string) – Path to the folder containing images.
  • include_subdirs (bool, default: True) – Whether to scan subdirectories.
  • selection_mode (choice, default: random) – Image selection method.
  • index (int) – Used when selection_mode=by_index.
  • filename_query (string) – Used when selection_mode=by_filename or by_query.
  • random_source (choice, default: auto) –
    • auto: use Random.org if API key is configured, else local PRNG.
    • local: always use local PRNG.
    • random_org: force Random.org usage (requires API key).
  • ensure_unique (bool) – Prevent repeats during a session.
  • unique_scope (choice) – "directory" or "global".
  • history_size (int, default: 512) – Max remembered items.
  • time_window_sec (int, default: 0) – Forget items older than this many seconds.
  • show_preview (bool, default: False) – Show a preview thumbnail on the node after each run.
  • retry_limit (int, default: 16) – Max retries when avoiding duplicates.

πŸ–₯️ Outputs

  1. image – The loaded image tensor.
  2. path_current – Full path of the selected image (current).
  3. index_current – Index of the selected image (current).
  4. filename_current – Filename of the selected image.
  5. width – Width of the image in pixels.
  6. height – Height of the image in pixels.
  7. sha256 – SHA256 checksum of the file (useful for deduplication).
  8. total_count – Total number of eligible images discovered in the directory (after filters).
  9. path_previous – Full path of the image from the previous run.
  10. index_previous – Index of the image from the previous run.

πŸ”‘ Random.org Setup (optional)

  • To enable true randomness, place your API key in random_org_api_key.json next to the node:
  1. Create random_org_api_key.json next to RandomOrgV2.py:

    {
      "api_key": "YOUR_API_KEY_HERE"
    }
    
  2. Or set an environment variable before launching ComfyUI:

    export RANDOM_ORG_API_KEY=YOUR_API_KEY_HERE
    

    On Windows (PowerShell):

    setx RANDOM_ORG_API_KEY "YOUR_API_KEY_HERE"
    

πŸ“Œ Notes

  • Current vs previous outputs make it easy to compare selections.
  • Session-lifetime uniqueness resets when Python restarts.
  • Directory history is persisted to yfg_dir_history.json and survives restarts (max 50 entries).
  • API limits: Random.org quotas apply β€” check your dashboard.

Random Prompt From File

YFG Random Prompt From File

Selects a single prompt entry from a .txt prompt file using true random.org numbers (or local PRNG). Outputs positive, negative, and name text directly β€” no additional nodes or wiring required.

✨ Features

  • Built-in file browser
    • πŸ“„ Browse for File button opens a navigable server-side file picker showing directories and .txt files, with a live prompt count badge per file.
    • πŸ• Recent Files button shows an MRU list of previously used files for quick re-selection.
    • Used files are saved automatically to yfg_file_history.json on each run.
  • Auto range population
    • range_start and range_end fill automatically (0 and totalβˆ’1) whenever a file is selected β€” no manual entry needed.
  • Last-N toggle
    • last_n_only restricts the random pool to the last N entries in the file β€” ideal when new prompts are appended to the bottom and you want to pick only from the newest additions.
  • Incremental modes
    • incremental walks the file in order, advancing one prompt per run and wrapping back to the start after the last entry β€” ideal for continuous batch runs.
    • incremental_no_wrap does the same sequential walk but stops at the end and holds there β€” ideal for a single clean pass through a range with no repeats.
  • Inline output value display
    • index_current, index_previous, total_count, and file_name are shown directly on the output slots after each run.
  • INDEX auto-sync
    • The INDEX widget updates automatically after every run so switching to by_index mode requires no manual typing.
  • True random.org integration
    • Uses the same Random.org API key as the Random Number nodes β€” no separate setup needed.
  • Uniqueness filtering
    • Avoids repeating prompts within a session with configurable history size and time window.
  • Shuffle bag
    • Cycles through all prompts in the pool before repeating, then reshuffles β€” guarantees uniform coverage.

πŸ“„ Prompt File Format

positive: your positive prompt here

negative: ugly, deformed, watermark

----
positive: second prompt

negative:

name: Optional Label
----
  • Entries separated by any number of hyphens (-, --, ----) on their own line
  • negative: content may be empty
  • name: is optional β€” defaults to the filename stem
  • Leading/trailing separator lines are silently ignored
  • UTF-8 encoding required

πŸ”§ Input Parameters

  • prompt_file (string) – Path to the .txt prompt file. Use πŸ“„ Browse or πŸ• Recent buttons.
  • selection_mode (choice, default: random) – How the prompt is chosen:
    • random – picks randomly from range_start..range_end.
    • by_index – uses the INDEX widget value directly.
    • incremental – advances one prompt per run from range_start to range_end, then wraps back to range_start. See Incremental Modes below.
    • incremental_no_wrap – same sequential walk, but stops at range_end and holds there.
  • index (int) – Used when selection_mode=by_index. Auto-syncs after every run.
  • range_start (int, default: 0) – First prompt index in the pool. Auto-fills to 0 when a file is selected. Also the wrap-back point in incremental mode.
  • range_end (int, default: 0) – Last prompt index in the pool. Auto-fills to totalβˆ’1 when a file is selected. 0 = last prompt. Also the wrap trigger in incremental mode.

Out-of-range bounds are clamped, not rejected, so a bad range degrades to a usable pool instead of failing mid-queue. Every adjustment is reported in the console:

  • range_start beyond the last prompt is pulled back to the last index.
  • range_end beyond the last prompt is pulled back to the last index.
  • range_end below range_start is an inverted range and collapses to a single entry at range_start. In incremental_no_wrap that is indistinguishable from a finished walk, which is why it is called out explicitly.
  • last_n_only (bool, default: False) – When ON, restricts the pool to the last N entries only. Applies to random mode only.
  • last_n_count (int, default: 100) – How many entries from the end to include when last_n_only is ON.
  • random_source (choice, default: auto) – auto, local, or random_org.
  • ensure_unique (bool, default: True) – Avoid repeating prompts within a session.
  • history_size (int, default: 100) – How many recent indices to track for uniqueness.
  • time_window_sec (int, default: 0) – Forget entries older than this many seconds.
  • retry_limit (int, default: 20) – Max attempts before falling back to last candidate.
  • use_shuffle_bag (bool, default: True) – Cycle through all prompts before repeating, then reshuffle.

πŸ–₯️ Outputs

  1. positive – Positive prompt text.
  2. negative – Negative prompt text (empty string if not specified in file).
  3. name – Prompt name from the name: field, or filename stem if omitted.
  4. index_current – 0-based index of the selected prompt. Auto-syncs to INDEX widget.
  5. index_previous – Index of the prompt selected in the previous run this session.
  6. total_count – Total number of valid prompts found in the file.
  7. file_path – Full path to the selected prompt file. Wire into a metadata field or display node as needed.
  8. file_name – Filename only (no path). Displayed inline on the output slot after each run; full path shown on hover.
  9. range_start – First index of the pool actually used this run. Resolved, not the raw widget value β€” reflects clamping and last_n_only narrowing.
  10. range_end – Last index of the pool actually used this run. Resolved, so a widget value of 0 reports as totalβˆ’1.

Outputs are appended, never reordered. Slots 1–8 keep the same positions they had in earlier versions, so workflows saved before range_start / range_end existed load with all their links intact.

πŸ” Incremental Modes

Two modes walk the prompt file in order rather than picking randomly. Both advance the index by exactly 1 per run; they differ only in what happens at the end of the range.

| Mode | At range_end | Use when | | --- | --- | --- | | incremental | Wraps back to range_start and repeats indefinitely | Running continuously and you want the file to loop | | incremental_no_wrap | Holds at range_end, returning it on every subsequent run | Making a single clean pass with no repeats |

How it works

  • The first run returns the prompt at range_start.
  • Each subsequent run advances the index by exactly 1.
  • On reaching range_end, behavior depends on the mode (see table above).
  • The INDEX widget ticks up visibly on every run, so the current position is always on screen.

With range_start=0 and range_end=4, a queue of 12 runs produces:

incremental          β†’ 0 1 2 3 4 0 1 2 3 4 0 1
incremental_no_wrap  β†’ 0 1 2 3 4 4 4 4 4 4 4 4

When incremental_no_wrap reaches the end, a notice is printed to the ComfyUI console on each further run so the exhausted range isn't silent.

Bounds

range_start and range_end define the walk. Since both auto-fill to 0 and totalβˆ’1 when a file is selected, the default behavior covers the entire file. Narrow them to walk a subset β€” for example range_start=500, range_end=549 covers just those 50 prompts.

Automatic reset

Position is tracked per mode, per file, and per range. Changing the prompt file, range_start, range_end, or switching between the two incremental modes resets the counter to range_start on the next run β€” no manual reset needed. To reset without changing anything, switch to by_index, set INDEX to your desired starting point, then switch back.

Interaction with other settings

ensure_unique, use_shuffle_bag, random_source, and last_n_only are all ignored in both incremental modes β€” sequential traversal already controls exactly which prompt comes next.

πŸ”‘ Random.org Setup (optional)

Uses the same random_org_api_key.json file as the Random Number nodes β€” see Random.org True Random Number (V2) for setup instructions.

πŸ“Œ Notes

  • Session-lifetime uniqueness resets when Python restarts.
  • Incremental position is held in memory for the session. Restarting ComfyUI restarts the walk at range_start in both incremental modes.
  • File history is persisted to yfg_file_history.json and survives restarts (max 20 entries).
  • File cache β€” parsed prompt files are cached in memory keyed by modification time. Re-parsing only occurs when the file changes on disk β€” zero overhead on repeat runs.
  • API limits: Random.org quotas apply β€” check your dashboard.

Display Value

YFG Display Value

A minimal utility node that displays any value β€” INT, FLOAT, or STRING β€” inline in both the node body and the title bar. Designed to replace large display nodes (like ShowText or Display Int) wherever a compact read-only indicator is all that's needed.

✨ Features

  • Title bar display β€” value shown as value | label so it's always visible even when the node is collapsed to its smallest size.
  • In-body display β€” green value rendered in the node body when expanded, no extra height added.
  • Rename to label β€” double-click the node title in ComfyUI to set a custom label (e.g. Index, Width, Seed). The value is appended automatically after each run.
  • Any type β€” accepts INT, FLOAT, or STRING on the single input slot via wildcard.
  • Persistent β€” last value is saved into the workflow JSON and pre-filled on reload.

πŸ”§ Inputs

  • value (any) – The value to display.

πŸ“Œ Notes

  • No outputs β€” this is a pure display/monitoring node.
  • The node title format is value | label. Rename the node to change the label; the value portion updates automatically on each run.

CivitAI MetaSave

YFG CivitAI MetaSave

Looking for the newest version? See CivitAI MetaSave V2 below. V1 is frozen and will not change, so existing workflows keep working exactly as they are.

Saves images with full A1111-compatible metadata embedded so that CivitAI automatically recognizes and displays generation info β€” model, LoRA weights, embeddings, sampler settings, seed, and prompts β€” exactly as it does for Automatic1111 outputs.

A single node replaces the two-node workflow required by other metadata extensions. Four optional custom key/value extra-metadata pairs are built directly into the node β€” no helper nodes required.

Compatible with classic SD (KSampler, KSamplerAdvanced), Flux, SD3, Ideogram, SamplerCustomAdvanced, LoRA, and upscale workflows.

✨ Features

  • CivitAI auto-recognition β€” embeds the parameters text chunk that CivitAI parses for resources, prompts, and settings, identical to A1111 output.
  • Multi-format output β€” PNG, JPEG, or WebP, each with an optional sidecar workflow JSON.
  • EXIF embedding β€” JPEG and WebP outputs also receive EXIF UserComment metadata so CivitAI can read them regardless of format.
  • Model & resource hashing β€” SHA-256 hashes (first 10 hex chars) for checkpoint, VAE, LoRA, and embedding files are computed and cached on disk to avoid redundant re-hashing.
  • LoRA detection β€” finds LoRA weights from both LoraLoader nodes and inline <lora:name:weight> syntax in the prompt text.
  • Filename tokens β€” supports %date:yyyy-MM-dd%, %seed%, %model%, %pprompt:32%, %nprompt:32%, %width%, %height% in the filename prefix.
  • Subdirectory support β€” optional sub-folder creation inside the output directory, also supporting date tokens.
  • Metadata scope control β€” choose what gets embedded: full, default, parameters only, workflow only, or none.
  • Four inline extra metadata slots β€” attach custom key/value pairs (e.g. workflow name, prompt index, project tag) without any additional nodes.

πŸ”§ Input Parameters

  • images (IMAGE) – Images to save.
  • filename_prefix (string, default: ComfyUI) – Output filename prefix. Supports tokens: %date:yyyy-MM-dd%, %seed%, %model%, %pprompt:32%, %nprompt:32%, %width%, %height%.
  • subdirectory_name (string) – Optional sub-folder inside the output directory. Supports %date% tokens. Leave blank to use the default output folder.
  • output_format (choice, default: png_with_json) – Image format. The *_with_json variants also write a sidecar .json workflow file.
    • png / png_with_json
    • jpg / jpg_with_json
    • webp / webp_with_json
  • quality (choice, default: max) – Output quality level. Ignored for PNG.
    • max β€” 100 (lossless WebP)
    • high β€” 80
    • medium β€” 60
    • low β€” 30
  • metadata_scope (choice, default: full) – Controls what metadata is embedded.
    • full β€” A1111 parameters string + full ComfyUI workflow JSON
    • default β€” same as the built-in SaveImage node
    • parameters_only β€” A1111-style parameters string only
    • workflow_only β€” ComfyUI workflow JSON only
    • none β€” no metadata
  • include_batch_num (bool, default: false) – Append a 5-digit batch index to the filename when saving multiple images.
  • prefer_nearest (bool, default: true) – When multiple upstream nodes provide the same field, prefer the one closest (fewest graph hops) to this node.
  • extra_key1 / extra_value1 (string, optional) – Custom metadata key/value pair 1.
  • extra_key2 / extra_value2 (string, optional) – Custom metadata key/value pair 2.
  • extra_key3 / extra_value3 (string, optional) – Custom metadata key/value pair 3.
  • extra_key4 / extra_value4 (string, optional) – Custom metadata key/value pair 4.

πŸ“Œ Notes

  • piexif must be installed (pip install piexif). It is listed as a dependency in pyproject.toml and should install automatically via ComfyUI Manager.
  • Hash cache is stored in civitai_metasave/.cache/model_hash_cache.json. Hashes are computed once per file and reused on subsequent runs β€” no performance penalty after the first generation.
  • Steps are required for full metadata. If no Steps value is found upstream, the parameters string is skipped and a warning is printed to the console. This is a CivitAI requirement, not a bug.
  • Workflow attribution β€” derived from comfyui_image_metadata_extension by edelvarden which itself was a fork of ComfyUI-SaveImageWithMetaData. Maintained and extended independently as part of YFG Comical.

CivitAI MetaSave V2

YFG CivitAI MetaSave V2

Second-generation metadata save node. Shares the entire capture, trace, and hashing pipeline with V1, but with a cleaner layout and several capabilities V1 could not gain without breaking saved workflows.

Both versions can be installed and used side by side. V1 is frozen; new work happens here.

πŸ†• What's new versus V1

| | V1 | V2 | | --- | --- | --- | | Extra metadata fields | 4 fixed pairs | Grows as you use them, up to 32 pairs | | Filename tokens | Fixed set only | Plus any extra field or captured metadata field | | File numbering | First file unnumbered | Configurable mode, start value, and padding | | output_format | 6 entries (png, png_with_json, …) | 3 entries plus a save_workflow_json toggle | | quality | 4 preset buckets | Integer 1–100 | | Outputs | None | filename and filepath |

✨ Features

  • Everything V1 does β€” CivitAI auto-recognition, model/LoRA/embedding hashing with an on-disk cache, inline <lora:name:weight> detection, EXIF embedding for JPEG and WebP, and metadata scope control.
  • Dynamic extra metadata fields β€” one empty key/value pair sits at the bottom of the node. Fill it and another appears; clear the trailing ones and the surplus is pruned. Values can be typed or wired from another node.
  • Metadata-aware filename tokens β€” build filenames from your own extra fields or from any captured metadata value.
  • Configurable numbering β€” number every file including the first, choose the starting number, and set the digit padding.
  • Filename and filepath outputs β€” chain the saved path into a logger, display node, or downstream tooling.

πŸ”§ Input Parameters

  • images (IMAGE) – Images to save.
  • filename_prefix (string, default: ComfyUI) – Output filename prefix. See Filename tokens below.
  • subdirectory_name (string) – Optional sub-folder inside the output directory. Supports the same tokens. Leave blank for the default output folder.
  • output_format (choice, default: png) – png, jpg, or webp.
  • save_workflow_json (bool, default: false) – Also write a sidecar .json file containing the raw workflow.
  • quality (int, default: 100) – Compression quality 1–100 for jpg and webp. 100 is lossless for webp. Ignored for png.
  • metadata_scope (choice, default: full) – full, default, parameters_only, workflow_only, or none.
  • filename_numbering (choice, default: always) – always numbers every file including the first; on_conflict only adds a number when the name already exists.
  • numbering_start (int, default: 1) – First number to use. 0 starts at 0000, 1 starts at 0001.
  • numbering_padding (int, default: 5) – Digits to pad to. 5 gives 00001, 4 gives 0001.
  • include_batch_num (bool, default: false) – Append a 5-digit batch index when saving multiple images from one run.
  • prefer_nearest (bool, default: true) – When several upstream nodes supply the same metadata field, prefer the one fewest graph hops away.
  • extra_key1 / extra_value1 (string, optional) – First custom metadata pair. Additional pairs appear automatically as you use them. See Dynamic extra metadata fields below.

πŸ–₯️ Outputs

  1. filename – Filename of the last image saved this run, including extension.
  2. filepath – Full absolute path of the last image saved this run.

🏷️ Filename tokens

| Token | Resolves to | | --- | --- | | %date:yyyy-MM-dd% | Current date/time. Supports yyyy MM dd hh mm ss | | %seed% %model% %width% %height% | Values captured from the workflow | | %pprompt:32% %nprompt:32% | Positive/negative prompt, truncated to N characters | | %extra:KEY% | Value of your extra metadata field named KEY | | %extra:KEY:12% | Same, truncated to 12 characters | | %KEY% | Your extra field KEY, or any captured metadata field such as %Sampler%, %Steps%, %CFG scale% |

Key matching is case-insensitive. Unresolved tokens are replaced with nothing and logged to the console, so a typo is visible rather than silently baked into a filename.

A literal / typed into filename_prefix still creates a subfolder; slashes and other illegal characters inside substituted values are replaced with _ so prompt text can be used safely.

Example: %date:yyyy-MM-dd%/YFG-%extra:Prompt Index%-%seed%

βž• Dynamic extra metadata fields

The node starts with one extra_key1 / extra_value1 pair. Type a key or wire a value into it, and extra_key2 / extra_value2 appear beneath. Clear the trailing pairs and the extras are removed again, always leaving exactly one empty pair ready. Up to 32 pairs.

The usual pattern is to type the key and wire the value:

Random Prompt From File  ──▢  extra_value1     extra_key1 = Prompt Index
                         ──▢  extra_value2     extra_key2 = Filename

Values can be typed instead, and both strings and numbers are accepted β€” a wired integer 0 is recorded as 0, not dropped.

Pairs are written to the image in numeric order. A pair with an empty key is skipped; a pair with a value but no key raises an error rather than silently discarding data.

This is driven by web/js/civitai_metasave_v2.js, which ships with the pack. ComfyUI's native COMFY_AUTOGROW_V3 inputs would remove the need for it, but they are resolved during the socket pass of the frontend's addInputs(), which runs before the widget pass β€” so the initial groups render above the node's ordinary widgets rather than below them. The extension keeps the layout correct and also grows on typing, not only on connecting.

πŸ“Œ Notes

  • piexif must be installed (pip install piexif). It is listed in pyproject.toml and installs automatically via ComfyUI Manager.
  • Hash cache lives in civitai_metasave/.cache/model_hash_cache.json, shared with V1. Each model file is hashed once and reused afterwards.
  • Steps are required for full metadata. If no Steps value is found upstream, the parameters string is skipped and a warning is printed. This is a CivitAI requirement, not a bug.
  • Both versions share one set of execution hooks. They live in the same package deliberately β€” a separate folder per version would re-apply ComfyUI's execution monkey-patches once per copy.
  • Attribution β€” derived from comfyui_image_metadata_extension by edelvarden, itself a fork of ComfyUI-SaveImageWithMetaData by nkchocoai. The dynamic-input technique is adapted from rgthree-comfy. Maintained and extended independently as part of YFG Comical.

Live Preview Panel

YFG Live Preview Panel

A floating, draggable live preview window that mirrors the KSampler preview so you can watch generation progress from anywhere in your workflow β€” no more panning back and forth to the sampler node to check on a render or catch a bad generation early.

This is a pure frontend extension β€” it has no node, no inputs, and no outputs. It simply appears as a floating panel over the canvas, similar to ComfyUI's built-in minimap. Under the hood it listens to the same websocket events (progress and b_preview) that drive the KSampler's own inline preview, so it adds zero backend overhead.

✨ Features

  • Live preview image β€” updates in real time as the sampler works, exactly like the in-node preview.
  • Progress bar & step counter β€” shows step N / M (%) for the currently executing node.
  • Executing node indicator β€” displays the title and ID of whichever node is currently running (e.g. β–Ά KSampler (#53)).
  • πŸ›‘ Cancel button β€” interrupts the current generation from anywhere, without touching the sampler node.
  • Drag & resize β€” move it by the header, resize from the bottom-right grip. Position and size are remembered between sessions.
  • Collapse & hide β€” β€” collapses to just the title bar; βœ• hides the panel (it reappears automatically on the next run).
  • Keyboard toggle β€” Alt+Shift+L shows/hides the panel at any time.
  • Settings switch β€” a master on/off toggle in ComfyUI Settings (search for "YFG"): 🐯 Enable Live Preview panel. When off, the panel never appears, even during generations.

πŸ“Œ Notes

  • Previews require ComfyUI's preview generation to be enabled (the default). If you launch ComfyUI with --preview-method none, the panel will still show progress and the executing node, but no image.
  • The panel auto-appears whenever a generation starts (unless disabled in Settings). If you close it with βœ•, it comes back on the next run β€” or press Alt+Shift+L to bring it back immediately.
  • The hotkey deliberately avoids Alt+Shift+P, which is reserved by Microsoft Edge for tab grouping.

Power Lora Loader Extras

(companion enhancement, no new node)

Power Lora Loader Extras menu

A pure frontend enhancement for rgthree's Power Lora Loader (rgthree) node β€” adds sort, bulk strength control, randomization, and drag-and-drop reordering directly to its own right-click menu. No new node type, nothing to wire up: just right-click any Power Lora Loader on your canvas.

✨ Features

  • 🐯 YFG: Sort Loras β€” reorder the lora list by Name (A-Z/Z-A), Strength (High-Low/Low-High), or Enabled First.
  • 🐯 YFG: Nudge All Strengths β€” bump every lora's strength up or down in sync (+0.05 / -0.05 / +0.10 / -0.10), or reset all back to 1.0 in one click.
  • 🐯 YFG: Randomize
    • Randomize Strengths… β€” prompts for a min,max range and assigns each lora a random strength within it.
    • Randomize On/Off (by % chance)… β€” prompts for a percent chance (0–100), rolled independently for each lora. This is a per-lora coin-flip, not a target count β€” e.g. asking for 20% on a list of 30 loras means each one has a 1-in-5 chance of landing on, so the total enabled will vary run to run (often somewhere around 6, but not always).
    • Enable Exactly N Loras… β€” prompts for a whole number and turns on exactly that many, chosen at random, with the rest off. Use this instead of the percent option if you want a specific count every time.
    • πŸ” Auto-Randomize Each Queue Run β€” toggle to re-roll strengths/on-off automatically before each individual run in a queued batch. (Experimental β€” not yet confirmed reliable on all ComfyUI frontend versions.)
  • 🐯 YFG: Get Trigger Words β€” pulls trigger/trained words for the selected loras straight from rgthree's own cached CivitAI info (the same data behind its "Show Info" dialog) and shows them in a copyable dialog.
    • Enabled Loras Only / All Loras β€” choose the scope before fetching.
    • Handles both short curated CivitAI word lists and raw tag-frequency data (the kind extracted directly from a lora's training captions), deduplicating across all selected loras into one combined list.
    • No extra backend needed β€” this calls rgthree's own already-running /rgthree/api/loras/info endpoint directly, so it works out of the box wherever rgthree-comfy is installed.
    • Loras with no cached CivitAI info (never run through "Show Info," or genuinely untagged) are listed separately at the end so you know what's missing rather than being silently skipped.
  • 🐯 YFG: Reorder Panel (drag & drop) β€” opens a floating panel listing all loras; drag rows into the order you want and click "Apply & Close."

Reorder panel:

Drag and drop reorder panel

πŸ“Œ Notes

  • All changes (order, strengths, on/off state) are saved directly in the Power Lora Loader's own widget values β€” the workflow JSON remains 100% standard rgthree-comfy format, so files stay fully portable to installs that don't have this extension.
  • Requirement: rgthree-comfy must be installed. This ships as part of ComfyUI_YFG_Comical and loads automatically β€” no extra install step.
  • Get Trigger Words only returns data rgthree already has cached for a lora. If a lora has never had its info fetched (via rgthree's own "Show Info" on that row, or a CivitAI match), it'll show up in the "no trigger words found" list rather than triggering a fresh lookup. Copies only the trigger words to the clipboard.
  • Right-click directly on a lora row to get rgthree's own built-in menu (Show Info / Toggle / Move Up-Down / Remove) β€” the 🐯 additions live on the node's general right-click menu instead, so both work side by side.

Text Concat Swap

YFG Text Concat Swap

Joins two strings with a delimiter, plus a single clickable toggle that flips which string comes first. It replaces the usual manual dance of rewriting (or rewiring) the inputs of the core StringConcatenate node every time you want the style tail in front of the subject instead of behind it.

✨ Features

  • One-click order flip β€” the swap widget is a boolean button that reads A + B or B + A, so the current order is visible on the node face at a glance and changes with a single click.
  • No dangling delimiters β€” empty inputs are dropped before joining, so a muted or unconnected branch never leaves a stray , in the prompt.
  • None-safe β€” a None arriving from a muted upstream node (a bypassed VL captioner, for example) is coerced to an empty string instead of raising.
  • Escape-aware delimiter β€” \n, \t and \s can be typed into the single-line delimiter widget to get a newline, tab, or plain space.
  • Optional trim β€” trim_parts strips leading/trailing whitespace from each side before joining, so sloppy text boxes still produce clean output.
  • Order readout β€” a second order output emits A + B or B + A as a string, handy for piping into 🐯 YFG Display Value or into saved metadata.

πŸ”§ Input Parameters

  • text_a (STRING, multiline) – First string when swap is off.
  • text_b (STRING, multiline) – First string when swap is on.
  • delimiter (STRING) – Joiner placed between the two parts. Default , . Supports \n, \t, \s.
  • swap (BOOLEAN) – A + B (off) or B + A (on).
  • trim_parts (BOOLEAN) – trim (default) strips surrounding whitespace from each part; raw leaves both untouched.

πŸ–₯️ Outputs

  • text (STRING) – The concatenated result.
  • order (STRING) – A + B or B + A, reflecting the current toggle state.

πŸ“Œ Notes

  • Both text widgets honour ComfyUI dynamic prompts, and either can be converted to an input socket and driven from upstream nodes.
  • The delimiter is only inserted when both parts are non-empty β€” with one side blank the output is just the other side, unchanged.
  • Pure stdlib; no additional dependencies.

Examples

Sample Workflow

Example Workflow

If the embedded workflow doesn't load, use the JSON:
workflows/ComfyUI_YFG_Comical-Example-Workflow.json

All nodes as of 06-13-2024

All Nodes

Acknowledgements

Huge thanks to creators whose work inspires or integrates with these nodes:

…and many others. Thank you for your talent and generosity.