Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abhash

ComfyUI-Abhash

Custom ComfyUI nodes for multi-reference image loading and scene-by-scene / storyboard prompt generation — built for Flux (and LTX Video) reference workflows where you need several images and several scene prompts wired together without a wall of duplicate nodes.


What's in the box

Node (display name) Internal id What it does
Abhash: Load Ingredients AbhashLoadIngredients Custom drag-and-drop UI widget that lets you load up to 10 images/videos at once into one node, plus a rich-text prompt box with @(image_N) autocomplete tagging.
Abhash: Combine Ingredients AbhashCombineIngredients Utility to merge/standardize IMAGE outputs.
Abhash: Flux Reference Encode AbhashFluxReferenceEncode Drop-in replacement for a VAE EncodeReferenceLatent chain. Takes up to 10 optional images + active_slots, VAE-encodes only the slots that actually have an image, and appends them to reference_latents on your conditioning.
Abhash: Apply Ingredients (Flux / Image to Image) AbhashApplyIngredients Same idea as above, but also resizes every image to a shared megapixel target first (like ImageScaleToTotalPixels + VAE Encode + ReferenceLatent combined into one node).
Abhash: Apply Ingredients (LTX Video 2.3) AbhashApplyIngredientsLTX Scales all active images to a shared megapixel target (cropped to /32) and batches them into a single IMAGE tensor for LTX Video 2.3 workflows.
ab-node (Load 6 References) ab-node Loads up to 6 reference images (upload or pick from input/), outputs each individually and as one auto-resized batch, plus an active_count of how many are actually loaded.
ab-prompt-splitter (Scene Splitter) ab-prompt-splitter Splits one multiline script into 6 scene prompt strings using SCENE: 1SCENE: 6 markers, with optional global prefix/suffix text.
Abhash: Scene Sequence Loader AbhashSceneSequenceLoader Loads a JSON file of scenes from ComfyUI/input/ and outputs parallel lists (positive_prompt, negative_prompt, filename_prefix, scene_number, width, height) so ComfyUI iterates the whole pipeline once per scene in a single Queue Prompt run.
Abhash: Auto Split Scenes AbhashAutoSplitScenes 6 manually-editable scene text boxes. If you wire a script string into it, that auto-splits (via SCENE 1:SCENE 6: markers) and overrides the manual boxes.
Abhash: Storyboard Splitter AbhashStoryboardSplitter All-in-one: loads images from the Load Ingredients JSON data, splits a script into 6 scenes, and matches each scene to its tagged reference image(s) via @1/@image_1-style tags — outputs 6 (prompt, image) pairs.
Abhash: Storyboard Combine AbhashStoryboardCombine Utility to re-batch/standardize 6 images.
Abhash: Storyboard Reference Encode AbhashStoryboardReferenceEncode VAE-encodes 6 images and applies each (including multi-image batches per scene) to its own conditioning slot in one call.

All nodes live under the Abhash category in the ComfyUI node search/add menu.


Installation

Option A — ComfyUI Manager (recommended once published) Search for "Abhash" in the Manager and install.

Option B — git clone

cd ComfyUI/custom_nodes
git clone https://github.com/<your-username>/ComfyUI-Abhash.git

Option C — manual download

  1. Download this repo as a ZIP (CodeDownload ZIP).
  2. Extract it into ComfyUI/custom_nodes/ so the path looks like ComfyUI/custom_nodes/ComfyUI-Abhash/__init__.py.

Then, for any install method:

  1. Restart ComfyUI.
  2. Hard-refresh your browser (Ctrl+Shift+R) so the custom JS widgets load.

No extra pip install is required — everything used (torch, numpy, Pillow, comfy.utils, folder_paths) already ships with ComfyUI.


Quick start: scene-by-scene generation with Flux

The fastest way to see everything working together is the bundled example workflow:

  1. Open ComfyUI.
  2. Drag workflows/flux_scene_by_scene_workflow.json (or the -gguf.json variant if you run GGUF-quantized checkpoints) onto the canvas.
  3. On the ab-node, pick your reference images from the dropdowns (or upload new ones).
  4. On ab-prompt-splitter, write your story as one line per scene:
    Scene 1: A brave warrior stands on a hill as the sun rises.
    Scene 2: The warrior enters a mysterious cave.
    Scene 3: They meet an old hermit holding an oracle.
    Scene 4: The hermit hands over a glowing magic sword.
    Scene 5: The warrior raises the sword to the sky as lightning strikes.
    
    (Leading numbers/Scene X:/Scene X - prefixes are stripped automatically. If you write fewer than 5 lines, the last scene repeats to fill the rest.)
  5. Add global_prefix / global_suffix for things that should apply to every scene (character description, style, lighting, quality tags).
  6. Hit Queue Prompt. The workflow generates one image per scene, each wired to its matching reference image(s).

workflows/storyboard_ui_example.json and workflows/flux2_klein_storyboard_ui_example.json are two more full example graphs (Flux.2 Klein 9B) built around the Storyboard Splitter / Storyboard Reference Encode pair described below.


Usage notes per node

Abhash: Load Ingredients

Click Load Ingredients to upload up to 10 images/videos. Each loaded item shows up as a numbered thumbnail; typing @ in the prompt box opens an autocomplete menu that inserts a tag like @(image_2) referencing that slot — useful for telling the model which reference goes with which part of the prompt. Unused output slots return a tiny black placeholder image (not None), so it's safe to leave them wired into any downstream node without crashing the queue — ComfyUI still requires "required" image inputs to be connected to something.

Abhash: Flux Reference Encode / Apply Ingredients

Set active_slots to however many image_N inputs you actually wired up (e.g. 3 if you're using image_1image_3). Only those slots get VAE-encoded — the "(disabled)" placeholder slots are skipped even if they're wired in, so generation speed doesn't degrade as you wire more slots than you use. Use Apply Ingredients instead of Flux Reference Encode when you also need automatic resizing to a target megapixel count (equivalent to ImageScaleToTotalPixels).

ab-node (Load 6 References)

Each of the 6 dropdowns lists files from your ComfyUI input/ folder (or accepts a direct upload). You can also feed each slot from an external LoadImage node via the optional image_N inputs — those take priority over the dropdown selection. image_batch auto-resizes every loaded image to match the first one and concatenates them; active_count tells you how many of the 6 slots are actually filled.

ab-prompt-splitter (Scene Splitter)

Detects SCENE: 1 through SCENE: 6 markers (case-insensitive). If no markers are found, it falls back to treating each non-empty line as one scene, in order.

Abhash: Scene Sequence Loader

For batch/list-style iteration instead of 6 fixed scene slots. Put a JSON file (see nodes/scenes.example.json) into ComfyUI/input/, each entry needs at least id and prompt (negative_prompt, width, height are optional per-scene overrides). See nodes/README.md for full graph-wiring guidance for a Flux.2 Klein 9B pipeline.

Abhash: Storyboard Splitter

Feed it the ingredients_data JSON from an Abhash: Load Ingredients node plus a script using SCENE 1:SCENE 6: markers. Tag which reference image(s) belong to each scene with @1, @2, … (or @image_1, @image_2, …) anywhere in that scene's text — you can tag more than one image per scene (e.g. @1 @3) and all of them will be batched into that scene's image output. Tags are stripped from the cleaned prompt text automatically.


Repo layout

ComfyUI-Abhash/
├── __init__.py              # registers nodes + points ComfyUI at web/js
├── nodes.py                 # all node implementations (the file that's actually loaded)
├── web/js/                  # front-end widgets (drag-and-drop loader, autocomplete, etc.)
├── workflows/                # example ComfyUI graphs you can drag onto the canvas
├── nodes/                    # standalone reference/wiring guide for the Scene Sequence Loader
├── assets/                   # README image(s)
└── archive/                  # superseded/duplicate files kept for reference only, not loaded by ComfyUI

Note: archive/ contains earlier, now-superseded copies of nodes.py and the front-end JS that were bundled in the original project export. They are not imported anywhere and are safe to delete if you don't need the history.


Changelog highlights

  • Fixed: ImageScaleToTotalPixels: 'NoneType' object has no attribute 'movedim' — unused image_N outputs on Load Ingredients now return a small blank placeholder image instead of None, so wiring a "(disabled)" slot into any core ComfyUI node no longer crashes the queue. Combine Ingredients and Flux Reference Encode recognize and ignore this placeholder automatically.
  • Fixed: the @ autocomplete tag cleanup regex in the prompt box — tags now expand to distinct text (@(image_2)image 2) instead of all collapsing into the generic word "subject".
  • Added: Abhash: Flux Reference Encode — replaces a 10-way ImageScaleToTotalPixels + VAE Encode chain with one node that only processes the slots you actually loaded, avoiding redundant VAE calls.
  • Added: ab-node (6-slot reference loader) and ab-prompt-splitter (scene splitter) for fast multi-reference, scene-by-scene workflows.
  • Added: Abhash: Storyboard Splitter / Storyboard Reference Encode for tagging specific reference images to specific scenes with @N markers.

License

MIT — feel free to use, modify, and redistribute.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages