explaingit

kgonia/comfyui-kleinprunedte

Analysis updated 2026-05-18

2PythonAudience · vibe coderComplexity · 2/5LicenseSetup · moderate

TLDR

A ComfyUI custom node that correctly loads a smaller, pruned text encoder for the FLUX.2-klein-9B image generation model.

Mindmap

mindmap
  root((ComfyUI KleinPrunedTE))
    What it does
      Loads pruned text encoder
      Fixes size mismatch errors
      Infers layer shapes
    Tech stack
      Python
      ComfyUI
      FLUX.2 klein 9B
    Use cases
      Faster image generation
      Lower VRAM usage
      Custom node install
    Audience
      AI image generation users
    Setup
      ComfyUI Manager install
      Manual git clone
      Download model files

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Run FLUX.2-klein-9B image generation with a smaller, faster text encoder to save VRAM.

USE CASE 2

Fix size mismatch errors when trying to load the pruned Klein text encoder in ComfyUI.

USE CASE 3

Try the example workflow to generate images with recommended Klein settings.

USE CASE 4

Compare image quality and memory use between the full and pruned text encoders.

What is it built with?

PythonComfyUI

How does it compare?

kgonia/comfyui-kleinprunedte0-bingwu-0/live-interpreter010zx00x1/faresnipe
Stars222
LanguagePythonPythonPython
Setup difficultymoderatemoderateeasy
Complexity2/52/52/5
Audiencevibe codergeneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires downloading a gated model file after accepting a license on Hugging Face, plus a ComfyUI version with FLUX.2 support.

The node's code is MIT and free to use, but the pruned model weights inherit the FLUX Non-Commercial License, so the weights cannot be used for commercial purposes.

In plain English

ComfyUI-KleinPrunedTE is a small add-on node for ComfyUI, a visual tool for building AI image generation workflows. It adds support for a trimmed-down version of the text encoder used by the FLUX.2-klein-9B image generation model. A text encoder is the part of an image generation system that turns a written prompt into a form the rest of the model can use to create an image. The pruned version of this text encoder has 5.1 billion parameters instead of the original 8.2 billion, which the README says makes it about 35 percent smaller and cuts peak video memory use by around 5 gigabytes during encoding, while producing images that are nearly indistinguishable from the full-size encoder. However, because this pruned version has an irregular internal structure that varies layer by layer, ComfyUI's normal text encoder loading node cannot read it correctly and fails with an error. This project exists specifically to load that pruned checkpoint correctly by figuring out the right shape for each layer directly from the file itself, without needing any extra configuration files. Installation can be done through the ComfyUI Manager by installing from a Git URL, or manually by cloning the repository into ComfyUI's custom_nodes folder and restarting ComfyUI. No additional Python packages are needed since the node only relies on ComfyUI's own built-in tools, though it does require a version of ComfyUI that already supports FLUX.2. Using it requires downloading three separate model files and placing them in specific ComfyUI folders: the pruned text encoder itself, the main FLUX.2-klein-9B image generation model (which is gated and requires accepting a license and logging in on Hugging Face to download), and a matching VAE file. The repository includes an example workflow file that already has the new node wired in correctly with the recommended settings for this particular model. The code for this ComfyUI node is released under the MIT license, but the pruned model weights themselves are a derivative of FLUX.2-klein-9B and carry that model's FLUX Non-Commercial License, meaning the weights cannot be used commercially.

Copy-paste prompts

Prompt 1
Help me install ComfyUI-KleinPrunedTE using the ComfyUI Manager.
Prompt 2
Explain why the stock CLIPLoader fails on the pruned FLUX.2-klein-9B text encoder and how this node fixes it.
Prompt 3
Walk me through downloading the three model files needed and placing them in the right ComfyUI folders.
Prompt 4
Show me how to open and run the example Klein pruned text encoder workflow in ComfyUI.

Frequently asked questions

What is comfyui-kleinprunedte?

A ComfyUI custom node that correctly loads a smaller, pruned text encoder for the FLUX.2-klein-9B image generation model.

What language is comfyui-kleinprunedte written in?

Mainly Python. The stack also includes Python, ComfyUI.

What license does comfyui-kleinprunedte use?

The node's code is MIT and free to use, but the pruned model weights inherit the FLUX Non-Commercial License, so the weights cannot be used for commercial purposes.

How hard is comfyui-kleinprunedte to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is comfyui-kleinprunedte for?

Mainly vibe coder.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.