MCPcopy Index your code
hub / github.com/XLabs-AI/x-flux-comfyui

github.com/XLabs-AI/x-flux-comfyui @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
249 symbols 683 edges 19 files 12 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Guide

How to use

FLUX Finetuning scripts FLUX Finetuning scripts

Installation:

  1. Go to ComfyUI/custom_nodes
  2. Clone this repo, path should be ComfyUI/custom_nodes/x-flux-comfyui/*, where * is all the files in this repo
  3. Go to ComfyUI/custom_nodes/x-flux-comfyui/ and run python setup.py
  4. Run ComfyUI after installing and enjoy!

After the first launch, the ComfyUI/models/xlabs/loras and ComfyUI/models/xlabs/controlnets folders will be created automatically.

So, to use lora or controlnet just put models in these folders.

After that, you may need to click "Refresh" in the user-friendly interface to use the models.

For controlnet you need install https://github.com/Fannovel16/comfyui_controlnet_aux

Low memory mode

You can launch Flux utilizing 12GB VRAM memory usage. 1. Follow installation as described in repo https://github.com/city96/ComfyUI-GGUF 2. Use flux1-dev-Q4_0.gguf from repo https://github.com/city96/ComfyUI-GGUF

  1. Launch ComfyUI with parameters:
python3 main.py --lowvram --preview-method auto --use-split-cross-attention

In our workflows, replace "Load Diffusion Model" node with "Unet Loader (GGUF)"

FLUX Finetuning scripts

Models

We trained Canny ControlNet, Depth ControlNet, HED ControlNet and LoRA checkpoints for FLUX.1 [dev]

You can download them on HuggingFace:

IP Adapter

Instruction

  1. Update x-flux-comfy with git pull or reinstall it.
  2. Download Clip-L model.safetensors from OpenAI VIT CLIP large, and put it to ComfyUI/models/clip_vision/*.
  3. Download our IPAdapter from huggingface, and put it to ComfyUI/models/xlabs/ipadapters/*.
  4. Use Flux Load IPAdapter and Apply Flux IPAdapter nodes, choose right CLIP model and enjoy your genereations.
  5. You can find example workflow in folder workflows in this repo.

Limitations

The IP Adapter is currently in beta. We do not guarantee that you will get a good result right away, it may take more attempts to get a result. But we will make efforts to make this process easier and more efficient over time.

Core symbols most depended-on inside this repo

set_processor
called by 13
xflux/src/flux/modules/layers.py
attention
called by 9
xflux/src/flux/math.py
add_shift
called by 8
layers.py
fn_recursive_add_processors
called by 7
utils.py
fn_recursive_attn_processor
called by 7
utils.py
print_if_not_empty
called by 6
nodes.py
add_lora
called by 5
layers.py
attn_processors
called by 5
utils.py

Shape

Method 135
Function 63
Class 51

Languages

Python100%

Modules by API surface

xflux/src/flux/modules/layers.py45 symbols
layers.py30 symbols
xflux/src/flux/modules/autoencoder.py29 symbols
nodes.py29 symbols
utils.py23 symbols
xflux/src/flux/util.py19 symbols
model_init.py13 symbols
xflux/src/flux/controlnet.py12 symbols
xflux/src/flux/model.py11 symbols
xflux/src/flux/xflux_pipeline.py9 symbols
sampling.py9 symbols
xflux/src/flux/sampling.py8 symbols

For agents

$ claude mcp add x-flux-comfyui \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page