LF Nodes
Custom nodes with a touch of extra UX ✨ Client-side LLM chat, mid-workflow image editing, history for primitives, JSON manipulation, analytics nodes, CivitAI metadata fetching and saving... and more!
Nodes (138)
ACE-Step Remix is a bridge, not a model — the opt-in is the whole story
Background removal without leaving your ComfyUI graph
Overlay one image on another with a slider, and actually see it happen
Decode raw file bytes back into an image tensor
Fake lens glow in one node
Blur an entire batch of images at once, by percentage, with filenames intact
A boolean primitive with history and randomization — the toggle that remembers
Gamma, midpoint, and localized lift
Auto-tag your images the way anime models were trained
Role-play with a local LLM from inside your workflow — no API key required
Pick checkpoints with cover art, or stress-test your whole model folder on autopilot
Making your generations actually show their used resources on CivitAI
Midtone contrast plus sharpening in one pass
Steal the color style from one image and apply it to another, with charts to prove it
A slide-to-compare node for before/after checks
Midpoint control and local edge contrast, not a blunt slider
Where this pack's widgets get their looks (and colors)
Make a mask by typing what you want to select
Strip the color per channel — the control that a grayscale slider never gives you
Find the objects in a frame, automatically
Pick a diffusion model with a cover image and CivitAI info
A display-only node for booleans, so your graph shows its truth
Make the float on the wire visible — the smallest debugging node in the pack
A debug probe for integer values
See the JSON on the wire without reaching for a text node
Every number and string on your graph, wrapped in one JSON
A string you can actually read
With a preview and CivitAI info
A blank canvas, on demand, any size, any color
Turn a LoRA filename into prompt keywords, automatically
One substring, pulled out and typed five different ways
Give your images that 35mm texture without leaving the graph
A float slider that remembers your last fifty values
The blur node with a preview, because blur is rarely a surprise
Ask Google Gemini from inside your workflow
Grab a random key from a JSON object, reproducibly
Pluck a value out of a JSON blob without writing a single line of Python
Ask a local LLM what's in your image, and get a verdict to branch on
A/B testing without the squinting or the tab-switching
Read your image's exposure like a photographer, not a guesser
The dumbest node you'll be glad exists
Generating a batch of placeholder canvases sized to your JSON
Pause mid-workflow and hand-edit the image before it goes on
Flip through your whole batch in the node — a carousel for image lists
Turn a raster into a real SVG, right in the graph
Inpaint without a separate KSampler
The inpainter that crops first, so small fixes get full-res detail
LF Nodes' history trick
Ask the image which way it's facing, then branch on the answer
Generate every prompt combination from one JSON blob
Find the duplicate keyword wrecking your prompt
Prompt building with checkboxes instead of typing
Draw a line on an image, with an honest coordinate system
Chat with a local LLM inside your workflow, then use the answer
Roleplay with a character, get a styled prompt out the other end
Load images from disk and edit them before they touch the model
Load CLIPSeg, the 'make a mask from a sentence' model
Load each file exactly once — the batch-processing cheat code
Dump a folder of images into your workflow and actually find the one you want
The local JSON loader that doesn't want your URL
...> prompt and actually get the LoRA
Pulling generation parameters back out of an image file
Load the WD14 tagger (the accurate, heavy way)
Load the WD14 tagger the light way (ONNX)
One picker that loads a LoRA *and* its twin embedding
The LoRA picker that shows you the cover art and spits out a ready-to-paste tag
Applying a color-grade LUT with a live before/after slider
Turn a color transformation into a reusable LUT
Let a local LLM write your docs — no API key needed
One formula string instead of a pile of Add/Multiply nodes
Batch-resize a folder of images without leaving the graph
Normalize a sprite batch without hand-positioning every frame
Get pinged when the render finishes — and requeue from the notification
Pick a YOLO model from a dropdown
Drop a GPT call into your ComfyUI graph
Parsing keyword-encoded LoRA tags out of a prompt
Turn a 24fps batch into a smooth looping animation
A weighted coin flip for your workflow
Find-and-replace for prompts, using real Python regex
Hand an LLM your code one function at a time
Turn a detected box into a usable mask
The rescue node that makes orphaned output files show up in ComfyUI
Aspect-preserving resize by long or short side
Resize to an exact size — crop or pad, your call
Cropping to a square without doing the math yourself
Roll the dice on portrait vs landscape
Pick your sampler from a dropdown that remembers
The one-number color fix
Get your textures into the game engine's format
A SaveImage replacement that actually gets your resources recognized
Writing any JSON blob in your graph to disk
Write that LLM-generated doc to disk, timestamp and all
Stop losing generated vectors to the void
The archive node for every string in your workflow
One node, one scene, in ComfyUI's visual-novel authoring suite
A scheduler dropdown with history, filtering, and randomization bolted on
Old-photo filter that doesn't commit you to full sepia
20 seeds out of one starting number
Write into a JSON object from the graph — the 'set' half of LF's JSON pair
Randomize the order of your JSON keys — for real this time
Put two images next to each other and actually see the difference
Convert anything to a number — and get the sum for free
Every string conversion you'd ever want, in one node
Sort your JSON keys and stop squinting at the tree
Put the quality tags first, before CLIP cuts them off
Teal shadows, orange highlights, zero photoshop
SDXL from the cloud, wired into your graph
A string node that remembers what you typed before
Find-and-replace for your prompt text, no regex required
Mail-merge for prompts
Turning typed text into a real JSON value
A ternary if/else for float values
The lazy image switch that only runs the branch you pick
A boolean switch for any integer in your workflow
Flip between two JSON datasets with one boolean
A lazy A/B switch for masks that doesn't waste VRAM
A boolean switch for text that doesn't make you squint at wires
Upscale past your VRAM limit without a crash
Turn your renders into a model-train set
The sharpen node that actually tells you what it's doing
Track which checkpoints and LoRAs you actually burn time on
Reference frames without leaving the canvas
An upscaler picker that remembers your last few and can randomize the rest
Twenty fresh seeds per run, straight from your CPU's entropy
A usage dashboard node with zero inputs
The same job as core, with a log that tells you the truth
Get your image into latent space, batch and all
A VAE picker with history, wildcard filtering, and a shuffle button
The saturation knob that doesn't wreck skin tones
A masonry grid for eyeballing every frame at once
See the vectors you've been generating blind
A fast, tweakable dark-edge filter that won't fight the GPU
Where a visual novel stops being nodes and becomes a bundle
The immutable 'save file' your narrative graph evaluates against
Branching that keeps every route in the graph
Concatenate up to ten prompt fragments, optionally in a blender
A JSON text box that catches your typos before the queue does
Pull a clip into ComfyUI input, with a verifiable receipt
LF Nodes
<div align="center">
Overview
A suite of custom nodes for ComfyUI aimed at enhancing user experience with more interactive and visually engaging widgets.
Most UI elements used by the frontend belong to the LF Widgets webcomponents library, a modern collection of modular and customizable webcomponents built on Stencil.js specifically to integrate with LF Nodes.

The nodes span quite a few categories:
- Analytics nodes: Visualize and track data, like checkpoint/LoRA usage or image histograms.
- Configuration nodes: Manage CivitAI metadata, and control the suite via the Control Panel.
- Filter nodes: Apply various filters to images, including blur, sharpen, and edge detection.
- Image manipulation nodes: Tools to manipulate images, such as filter and resize nodes.
- IO Operations nodes: Load and save files to/from the file system.
- JSON nodes: Tools to manipulate and display JSON data.
- Latent manipulation nodes: Latent decoding and encoding tools.
- LLM nodes: Interface with locally running LLMs, like the Messenger node, which also manages characters.
- Logic nodes: Control flow using simple switches.
- Primitive nodes: Work with primitive data types, offering features like history.
- Region nodes: Image region selection and editing tools.
- Seed generation nodes: Generate seeds for complex workflows.
- Selector nodes: Resource selection widgets with metadata display for models.
- Visual novel nodes: Author, validate, and preview deterministic target-neutral narrative graphs.
To see example workflows, check the example_workflows folder. For generic texture serialization, see DDS Output. For the current visual-novel node inputs and identity contract, see Visual Novel Nodes.
Table of Contents
Installation
ComfyUI Manager
- Open ComfyUI Manager.
- Search LF Nodes.
- Install the node suite and restart ComfyUI.
Manual
Method 1: Download ZIP
- Go to the releases page.
- Download the latest release ZIP file.
- Extract the contents of the ZIP file into the
ComfyUI/custom_nodesfolder. - Restart ComfyUI.
Method 2: Git Clone
- Go to the
ComfyUI/custom_nodesfolder. - Open a terminal.
- Copy and paste this command
git clone https://github.com/lucafoscili/lf-nodes.git.
Workflow Runner
The Workflow Runner miniapp is included in this package but is disabled by default.
To enable it you must set the environment variable WORKFLOW_RUNNER_ENABLED=true before starting ComfyUI.
By default the runner will not register its HTTP routes or static frontend when WORKFLOW_RUNNER_ENABLED is not set or set to a false value. This makes the runner opt-in and prevents accidental exposure of the runner endpoints.
Configuration is loaded from the repository-level .env file (at the project root).
Set WORKFLOW_RUNNER_ENABLED=true to enable the runner.
If you do enable it, ensure authentication/allowed-users are configured (see docs/WORKFLOW_RUNNER.md) to avoid unauthorised access.

Adding New Workflows
Reusable, project-agnostic workflows can ship with LF Nodes. To add one to the Workflow Runner, follow these steps:
-
Create the workflow JSON file
Export your ComfyUI workflow and save it asmodules/workflow_runner/workflows/<workflow_name>.json -
Create the workflow Python module
Create a corresponding Python filemodules/workflow_runner/workflows/<workflow_name>.pywith:- Workflow configuration function:
_configure(prompt, inputs)that maps user inputs to workflow node inputs - Input cells: Define
WorkflowCellobjects for each user input (uploads, text fields, checkboxes, etc.) - Output cells: Define
WorkflowCellobjects for each output (images, strings, JSON, etc.) - Workflow definition: Create a
WorkflowNodeobject with metadata and export it asWORKFLOW
- Workflow configuration function:
-
Register the workflow
Add your workflow module name to the_WORKFLOW_MODULEStuple inmodules/workflow_runner/workflows/__init__.py -
Update frontend types (if adding new output types)
If your workflow produces new output types:- Add the output interface to
web/workflow-runner/src/types/api.ts - Update
WorkflowNodeOutputsinterface to include your new type - Update output rendering in
web/workflow-runner/src/elements/components.tsandmain.outputs.ts
- Add the output interface to
-
Update node outputs (if needed)
If using custom nodes, ensure they return data in the expected format:- Set
OUTPUT_IS_LISTappropriately for batch/list outputs - Return structured data via
ui.lf_outputfor frontend consumption
- Set
Example commit: See commit 2fbb49e which adds the caption_image_vision workflow, demonstrating all these steps including updating LF_DisplayString to support string outputs and frontend components to render them.
Project-owned workflows do not need to be copied into this published package.
Store each workflow's .py definition and .json graph together in an external
directory, then set WORKFLOW_RUNNER_EXTRA_WORKFLOW_ROOTS in the repository-level
.env. The setting accepts comma- or semicolon-separated absolute directories.
Set WORKFLOW_RUNNER_EXTRA_WORKFLOW_GROUPS to a matching ordered list of safe
display labels when the drawer should group each registered root separately.
Packaged LF Nodes workflows remain grouped by their domain; external definitions
are shown only under their custom registration group.
External definitions use the same workflows.custom import contract as local
custom workflows, so their existing relative imports and workflow IDs can remain
stable.
External roots are trusted Python source: every discovered .py module can run
code during Workflow Runner startup. Point the setting only at directories you
control, use unique module filenames and workflow IDs, and restart ComfyUI after
changing the configured roots or their contents.
Preflighting Workflow JSON
Before queueing a large workflow, run the queue-free structural preflight from the LF Nodes repository root:
python -m modules.workflow_runner.scripts.workflow_preflight <workflow.json>
The command validates node/link integrity, verifies that every referenced LF
node type still exists, and exercises the same workflow-to-prompt conversion as
the runner. Add --require-all-lf-nodes when the file is intended to cover every
currently shipped LF node; missing coverage then becomes a failing exit status.
Image editor
The image editor node (LF_LoadAndEditImages) allows users to load images from disk and perform editing operations such as inpainting, adjusting saturations, brightness, contrast, and more, all through an interactive interface.
It's possible to select the images from the file system tree and then send them downstream to other nodes for further processing.

Notes
The LLM nodes were tested with Koboldcpp, but any Open AI-compatible endpoint that does not require authentication/an API key should work. The model used in the workflows samples is UCLA-AGI/Llama-3-Instruct-8B-SPPO-Iter3 with ChaoticNeutrals/LLaVA-Llama-3-8B-mmproj-Updated.
Contributing
Contributions to this repository are welcome, feel free to submit pull requests or open issues for discussion! To setup the environment clone this repository, then from the root open a terminal and run the command
pip install -r requirements.txt
This will install all the required dependencies for the Python backend.
To build the frontend, install Node.js with Corepack available, then run the command
corepack yarn install --immutable
This command will install all the dependencies. Note that the repository includes the compiled frontend sources, so you can skip this step if you don't plan to modify the frontend.
corepack yarn build
This command will compile all the frontend sources and generate/refresh the actual web directory.
License
MIT License
Documentation
For an overview of how this nodes suite is structured and how it integrates with the UI, see:
- Architecture
- DDS Output
- Frontend Proxy
- Image Editor
- Node Template
- Proxy
- Visual Novel Nodes
- Workflow Runner
