Extensions/LF Nodes
ComfyUI Extension

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!

By lucafoscili·Created 2 years ago·Updated 9 days ago· 35
lucafoscili/lf-nodes
Nodes138
On cloudLocal install
Category✨ LF Nodes/IO Operations, ✨ LF Nodes/Filters
Stars35
Updated9 days ago

Nodes (138)

ACE-Step Remix (opt-in)

ACE-Step Remix is a bridge, not a model — the opt-in is the whole story

✨ LF Nodes/IO Operations
Background Remover

Background removal without leaving your ComfyUI graph

✨ LF Nodes/Filters
Blend

Overlay one image on another with a slider, and actually see it happen

✨ LF Nodes/Filters
Blob to Image

Decode raw file bytes back into an image tensor

✨ LF Nodes/Image
Bloom

Fake lens glow in one node

✨ LF Nodes/Filters
Blur images

Blur an entire batch of images at once, by percentage, with filenames intact

✨ LF Nodes/Image
Boolean

A boolean primitive with history and randomization — the toggle that remembers

✨ LF Nodes/Primitives
Brightness

Gamma, midpoint, and localized lift

✨ LF Nodes/Filters
Caption Image (WD14, TAGGER)

Auto-tag your images the way anime models were trained

✨ LF Nodes/Analytics
LLM <-> Character

Role-play with a local LLM from inside your workflow — no API key required

✨ LF Nodes/LLM
Checkpoint selector

Pick checkpoints with cover art, or stress-test your whole model folder on autopilot

✨ LF Nodes/Selectors
CivitAI metadata setup

Making your generations actually show their used resources on CivitAI

✨ LF Nodes/Configuration
Clarity

Midtone contrast plus sharpening in one pass

✨ LF Nodes/Filters
Color Analysis

Steal the color style from one image and apply it to another, with charts to prove it

✨ LF Nodes/Analytics
Compare images

A slide-to-compare node for before/after checks

✨ LF Nodes/Image
Contrast

Midpoint control and local edge contrast, not a blunt slider

✨ LF Nodes/Filters
Control panel

Where this pack's widgets get their looks (and colors)

✨ LF Nodes/Configuration
Create Mask

Make a mask by typing what you want to select

✨ LF Nodes/Image
Desaturation

Strip the color per channel — the control that a grayscale slider never gives you

✨ LF Nodes/Filters
Detect Regions (YOLO)

Find the objects in a frame, automatically

✨ LF Nodes/Regions
Diffusion model selector

Pick a diffusion model with a cover image and CivitAI info

✨ LF Nodes/Selectors
Display boolean

A display-only node for booleans, so your graph shows its truth

✨ LF Nodes/Primitives
Display float

Make the float on the wire visible — the smallest debugging node in the pack

✨ LF Nodes/Primitives
Display integer

A debug probe for integer values

✨ LF Nodes/Primitives
Display JSON

See the JSON on the wire without reaching for a text node

✨ LF Nodes/JSON
Display primitive as JSON

Every number and string on your graph, wrapped in one JSON

✨ LF Nodes/Primitives
Display string

A string you can actually read

✨ LF Nodes/Primitives
Embedding selector

With a preview and CivitAI info

✨ LF Nodes/Selectors
Empty image

A blank canvas, on demand, any size, any color

✨ LF Nodes/Image
Extract prompt from LoRA tag

Turn a LoRA filename into prompt keywords, automatically

✨ LF Nodes/Logic
Extract string

One substring, pulled out and typed five different ways

✨ LF Nodes/Logic
Film grain

Give your images that 35mm texture without leaving the graph

✨ LF Nodes/Filters
Float

A float slider that remembers your last fifty values

✨ LF Nodes/Primitives
Gaussian Blur

The blur node with a preview, because blur is rarely a surprise

✨ LF Nodes/Filters
Gemini API (Google)

Ask Google Gemini from inside your workflow

✨ LF Nodes/LLM
Get Random Key From JSON

Grab a random key from a JSON object, reproducibly

✨ LF Nodes/JSON
Get Value from JSON

Pluck a value out of a JSON blob without writing a single line of Python

✨ LF Nodes/JSON
LLM Image classifier

Ask a local LLM what's in your image, and get a verdict to branch on

✨ LF Nodes/LLM
Image grid

A/B testing without the squinting or the tab-switching

✨ LF Nodes/Image
Image Histogram

Read your image's exposure like a photographer, not a guesser

✨ LF Nodes/Analytics
Images to list

The dumbest node you'll be glad exists

✨ LF Nodes/Image
Image list from JSON

Generating a batch of placeholder canvases sized to your JSON

✨ LF Nodes/JSON
Images editing breakpoint

Pause mid-workflow and hand-edit the image before it goes on

✨ LF Nodes/Image
Images slideshow

Flip through your whole batch in the node — a carousel for image lists

✨ LF Nodes/Image
Image to SVG

Turn a raster into a real SVG, right in the graph

✨ LF Nodes/Image
Inpaint

Inpaint without a separate KSampler

✨ LF Nodes/Filters
Inpaint (adv.)

The inpainter that crops first, so small fixes get full-res detail

✨ LF Nodes/Filters
Integer

LF Nodes' history trick

✨ LF Nodes/Primitives
Is image in landscape res.?

Ask the image which way it's facing, then branch on the answer

✨ LF Nodes/Logic
JSON Prompt Combinator

Generate every prompt combination from one JSON blob

✨ LF Nodes/JSON
Keyword counter

Find the duplicate keyword wrecking your prompt

✨ LF Nodes/Analytics
Keyword toggle from JSON

Prompt building with checkboxes instead of typing

✨ LF Nodes/JSON
Line

Draw a line on an image, with an honest coordinate system

✨ LF Nodes/Filters
LLM Chat

Chat with a local LLM inside your workflow, then use the answer

✨ LF Nodes/LLM
LLM Messenger

Roleplay with a character, get a styled prompt out the other end

✨ LF Nodes/LLM
Load and edit images

Load images from disk and edit them before they touch the model

✨ LF Nodes/IO Operations
Load CLIPSeg model

Load CLIPSeg, the 'make a mask from a sentence' model

✨ LF Nodes/Configuration
Load file from disk once

Load each file exactly once — the batch-processing cheat code

✨ LF Nodes/IO Operations
Load images from disk

Dump a folder of images into your workflow and actually find the one you want

✨ LF Nodes/IO Operations
Load JSON from disk

The local JSON loader that doesn't want your URL

✨ LF Nodes/IO Operations
Load LoRA tags

...> prompt and actually get the LoRA

✨ LF Nodes/Configuration
Load metadata from image

Pulling generation parameters back out of an image file

✨ LF Nodes/IO Operations
Load WD14 model (timm)

Load the WD14 tagger (the accurate, heavy way)

✨ LF Nodes/Configuration
Load WD14 model (ONNX)

Load the WD14 tagger the light way (ONNX)

✨ LF Nodes/Configuration
LoRA and embedding selector

One picker that loads a LoRA *and* its twin embedding

✨ LF Nodes/Selectors
LoRA selector

The LoRA picker that shows you the cover art and spits out a ready-to-paste tag

✨ LF Nodes/Selectors
LUT Application (filter)

Applying a color-grade LUT with a live before/after slider

✨ LF Nodes/Image
LUT Generation

Turn a color transformation into a reusable LUT

✨ LF Nodes/Analytics
Markdown doc. generator

Let a local LLM write your docs — no API key needed

✨ LF Nodes/LLM
Math operation

One formula string instead of a pile of Add/Multiply nodes

✨ LF Nodes/Logic
Multiple image resize for Web

Batch-resize a folder of images without leaving the graph

✨ LF Nodes/Image
Normalize sprite batch

Normalize a sprite batch without hand-positioning every frame

✨ LF Nodes/Image
Notify

Get pinged when the render finishes — and requeue from the notification

✨ LF Nodes/Configuration
ONNX selector

Pick a YOLO model from a dropdown

✨ LF Nodes/Selectors
OpenAI API (Chat)

Drop a GPT call into your ComfyUI graph

✨ LF Nodes/LLM
Parse Prompt with LoRA tags

Parsing keyword-encoded LoRA tags out of a prompt

✨ LF Nodes/Logic
Periodic image batch sampler

Turn a 24fps batch into a smooth looping animation

✨ LF Nodes/Image
Random boolean

A weighted coin flip for your workflow

✨ LF Nodes/Primitives
Regex replace

Find-and-replace for prompts, using real Python regex

✨ LF Nodes/Logic
Extract region from sources

Hand an LLM your code one function at a time

✨ LF Nodes/IO Operations
Region Mask

Turn a detected box into a usable mask

✨ LF Nodes/Regions
Register output file

The rescue node that makes orphaned output files show up in ComfyUI

✨ LF Nodes/IO Operations
Resize image by edge

Aspect-preserving resize by long or short side

✨ LF Nodes/Image
Resize image to dimension

Resize to an exact size — crop or pad, your call

✨ LF Nodes/Image
Resize image to square

Cropping to a square without doing the math yourself

✨ LF Nodes/Image
Resolution switcher

Roll the dice on portrait vs landscape

✨ LF Nodes/Logic
Sampler selector

Pick your sampler from a dropdown that remembers

✨ LF Nodes/Selectors
Saturation

The one-number color fix

✨ LF Nodes/Filters
Save DDS

Get your textures into the game engine's format

✨ LF Nodes/IO Operations
Save image with CivitAI-compatible metadata

A SaveImage replacement that actually gets your resources recognized

✨ LF Nodes/IO Operations
Save JSON

Writing any JSON blob in your graph to disk

✨ LF Nodes/IO Operations
Save Markdown

Write that LLM-generated doc to disk, timestamp and all

✨ LF Nodes/IO Operations
Save SVG

Stop losing generated vectors to the void

✨ LF Nodes/IO Operations
Save text

The archive node for every string in your workflow

✨ LF Nodes/IO Operations
Scene Spec

One node, one scene, in ComfyUI's visual-novel authoring suite

✨ LF Nodes/Visual Novel
Scheduler selector

A scheduler dropdown with history, filtering, and randomization bolted on

✨ LF Nodes/Selectors
Sepia

Old-photo filter that doesn't commit you to full sepia

✨ LF Nodes/Filters
Generate sequential seeds

20 seeds out of one starting number

✨ LF Nodes/Seed generation
Set/Create a Value in a JSON Object

Write into a JSON object from the graph — the 'set' half of LF's JSON pair

✨ LF Nodes/JSON
Shuffle JSON keys

Randomize the order of your JSON keys — for real this time

✨ LF Nodes/JSON
Side by side

Put two images next to each other and actually see the difference

✨ LF Nodes/Image
Convert to number

Convert anything to a number — and get the sum for free

✨ LF Nodes/Primitives
Convert to string

Every string conversion you'd ever want, in one node

✨ LF Nodes/Primitives
Sort JSON keys

Sort your JSON keys and stop squinting at the tree

✨ LF Nodes/JSON
Sort tags

Put the quality tags first, before CLIP cuts them off

✨ LF Nodes/Logic
Split Tone

Teal shadows, orange highlights, zero photoshop

✨ LF Nodes/Filters
Stability AI (Image Gen)

SDXL from the cloud, wired into your graph

✨ LF Nodes/LLM
String

A string node that remembers what you typed before

✨ LF Nodes/Primitives
String replace

Find-and-replace for your prompt text, no regex required

✨ LF Nodes/Logic
String template

Mail-merge for prompts

✨ LF Nodes/Logic
Convert string to JSON

Turning typed text into a real JSON value

✨ LF Nodes/JSON
Switch Float

A ternary if/else for float values

✨ LF Nodes/Logic
Switch Image

The lazy image switch that only runs the branch you pick

✨ LF Nodes/Logic
Switch Integer

A boolean switch for any integer in your workflow

✨ LF Nodes/Logic
Switch JSON

Flip between two JSON datasets with one boolean

✨ LF Nodes/Logic
Switch Mask

A lazy A/B switch for masks that doesn't waste VRAM

✨ LF Nodes/Logic
Switch String

A boolean switch for text that doesn't make you squint at wires

✨ LF Nodes/Logic
Tiled Super Resolution

Upscale past your VRAM limit without a crash

✨ LF Nodes/Image
Tilt Shift

Turn your renders into a model-train set

✨ LF Nodes/Filters
Unsharp Mask

The sharpen node that actually tells you what it's doing

✨ LF Nodes/Filters
Update usage statistics

Track which checkpoints and LoRAs you actually burn time on

✨ LF Nodes/Analytics
Upload images

Reference frames without leaving the canvas

✨ LF Nodes/IO Operations
Upscale model selector

An upscaler picker that remembers your last few and can randomize the rest

✨ LF Nodes/Selectors
Urandom Seed Generator

Twenty fresh seeds per run, straight from your CPU's entropy

✨ LF Nodes/Seed generation
Usage statistics

A usage dashboard node with zero inputs

✨ LF Nodes/Analytics
VAE Decode

The same job as core, with a log that tells you the truth

✨ LF Nodes/Latent
VAE Encode

Get your image into latent space, batch and all

✨ LF Nodes/Latent
VAE selector

A VAE picker with history, wildcard filtering, and a shuffle button

✨ LF Nodes/Selectors
Vibrance

The saturation knob that doesn't wreck skin tones

✨ LF Nodes/Filters
View images

A masonry grid for eyeballing every frame at once

✨ LF Nodes/Image
View SVGs

See the vectors you've been generating blind

✨ LF Nodes/Image
Vignette

A fast, tweakable dark-edge filter that won't fight the GPU

✨ LF Nodes/Filters
Compile VN

Where a visual novel stops being nodes and becomes a bundle

✨ LF Nodes/Visual Novel
VN State

The immutable 'save file' your narrative graph evaluates against

✨ LF Nodes/Visual Novel
VN Switch

Branching that keeps every route in the graph

✨ LF Nodes/Visual Novel
Wall of text

Concatenate up to ten prompt fragments, optionally in a blender

✨ LF Nodes/Primitives
Write JSON

A JSON text box that catches your typos before the queue does

✨ LF Nodes/JSON
YouTube Reference (opt-in)

Pull a clip into ComfyUI input, with a verifiable receipt

✨ LF Nodes/IO Operations
Readme
<!-- markdownlint-disable MD033 -->

LF Nodes

<div align="center">

LF Nodes

</div> <div align="center">

LFNodes

</div> <div align="center">

GitHub last commit

</div>

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.

Simple inpaint

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_nodes folder.
  • Restart ComfyUI.

Method 2: Git Clone

  • Go to the ComfyUI/custom_nodes folder.
  • 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.

Workflow Runner UI

Adding New Workflows

Reusable, project-agnostic workflows can ship with LF Nodes. To add one to the Workflow Runner, follow these steps:

  1. Create the workflow JSON file
    Export your ComfyUI workflow and save it as modules/workflow_runner/workflows/<workflow_name>.json

  2. Create the workflow Python module
    Create a corresponding Python file modules/workflow_runner/workflows/<workflow_name>.py with:

    • Workflow configuration function: _configure(prompt, inputs) that maps user inputs to workflow node inputs
    • Input cells: Define WorkflowCell objects for each user input (uploads, text fields, checkboxes, etc.)
    • Output cells: Define WorkflowCell objects for each output (images, strings, JSON, etc.)
    • Workflow definition: Create a WorkflowNode object with metadata and export it as WORKFLOW
  3. Register the workflow
    Add your workflow module name to the _WORKFLOW_MODULES tuple in modules/workflow_runner/workflows/__init__.py

  4. 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 WorkflowNodeOutputs interface to include your new type
    • Update output rendering in web/workflow-runner/src/elements/components.ts and main.outputs.ts
  5. Update node outputs (if needed)
    If using custom nodes, ensure they return data in the expected format:

    • Set OUTPUT_IS_LIST appropriately for batch/list outputs
    • Return structured data via ui.lf_output for frontend consumption

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.

Load and Edit Images

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:

Simple pipeline