Extensions/ComfyUI Flakes
ComfyUI Extension

ComfyUI Flakes

Stackable preset 'flakes' (prompt + LoRA + resolution + ControlNet) inserted between a checkpoint and a sampler.

By JeyzerMC·Created 6 months ago·Updated 9 days ago· 2
JeyzerMC/comfyui-flakes
Nodes12
On cloudLocal install
Categoryflakes
Stars2
Updated9 days ago
Readme
<div align="center">

ComfyUI Flakes

Reusable config presets — swap characters, styles, poses, checkpoints and more without rewiring your workflow

ComfyUI Flakes is a set of nodes aiming to facilitate batch generation of images with reusable presets. Combine LoRAs, prompts, controlnets and more into a flake.yaml file that can be loaded, swapped, disabled and tweaked easily within the Flakes ecosystem.

Extension Overview

</div>

Installation

Via ComfyUI Manager (Recommended)

Search for ComfyUI Flakes and click Install.

Manual

cd ComfyUI/custom_nodes
git clone https://github.com/JeyzerMC/comfyui-flakes

No extra dependencies — PyYAML is already part of ComfyUI's core.


Flake file format

Flakes are reusable .yaml config files under ComfyUI/models/flakes/. They can represent any image generation concept, such as a character, a style, an environment, a pose, etc. Each flake has a number of different fields it can have that will be passed during the generation.

The only field required inside the YAML is name — the display label used everywhere in the UI. The flake's stable identifier is its filename relative to models/flakes/ (subfolders included — characters/musashi.yaml is loaded as characters/musashi); that's the "output path" and lives in the filesystem rather than the file. Every other field below is optional — include only what your flake needs.

# ─── Required ─────────────────────────────────────────────────────────────
name: "Miyamoto Musashi"        # Display name shown in the UI and pickers

# ─── Optional fields ──────────────────────────────────────────────────────

# Prompt fragments contributed to the stack. Either side can be omitted.
prompt:
  positive: "1boy, miyamoto musashi, long wild black hair"
  negative: "modern clothing, glasses"

# LoRAs — list of one or more entries. `path` is the model path under
# `models/loras/`; `name` and `url` are metadata for the picker / link icon.
loras:
  - name: "Musashi"
    url: "https://civitai.com/models/..."   # optional, shown as link icon
    path: "<lora_path>/musashi"                # under models/loras/
    strength: 0.9                           # default 1.0

# Default resolution for the generation. The first flake in the stack that
# declares a `resolution` wins; otherwise it falls back to 1024 × 1024.
resolution: [832, 1216]

# Cover image shown on the flake's grid block and in the picker. Path is
# resolved under `models/loras/` (or, for legacy flakes, the sibling image
# of a .safetensors file).
cover_image: "<lora_path>/musashi.png"

# Variant groups — the UI lets you pick one choice per group. Each choice
# can contribute extra positive/negative text and an optional preview image.
variants:
  outfit:
    ronin:
      positive: "tattered kimono, frayed hakama"
      negative: "armor"
      image: "<lora_path>/musashi_outfit_ronin.png"    # optional preview thumbnail
    shirtless:
      positive: "shirtless, hakama only"
  mood:
    calm:
      positive: "serene expression"
    fierce:
      positive: "battle stance, narrowed eyes"

# ControlNets — one entry per ControlNet to apply.
controlnets:
  - type: openpose                            # ControlNet category label
    model: control_openpose_xl.safetensors    # file under models/controlnet/
    image: standing_openpose                  # file under ComfyUI/input/
    strength: 0.8                             # default 1.0
    start_percent: 0.0                        # default 0.0
    end_percent: 1.0                          # default 1.0

# Filename stem injected into `Save Image`'s filename_prefix when this flake
# is in the stack. Multiple flakes' stems are joined with underscores.
output_stem: "musashi"

# Flake links — pull in one or more other flakes' loras + prompts when this
# flake is used. Each link can set default variant choices and lora-strength
# overrides for its target. (A single legacy `flake_link:` mapping is still
# read for backwards compatibility.)
flake_links:
  - target: "styles/ink_wash"          # another flake's output path
    variant:
      intensity: heavy                 # default variant choice on the target
    lora_strengths: [0.8]              # per-lora overrides (null = target default)
  - target: "poses/standing"

Prompts are joined with BREAK between flakes so each flake acts as an independent CLIP region. LoRA strengths and variant choices can be overridden per-instance from the grid item's option panel without modifying the file on disk.

Flake Edit


Flake Model Preset

A Flake model preset is a config for checkpoints. Alongside the SDXL family it supports Anima, Krea2 and Z-Image.

Preset Edit

Model families

The model_family dropdown picks both the on-disk layout (img/<folder>/ under models/flakes/, models/flakes/model_presets/ and output/) and how the model is loaded and sampled.

| Family | Folder | Model file | Text encoder | Encoder type | VAE | |---|---|---|---|---|---| | SDXL/Base, SDXL/Illustrious, SDXL/Pony | sdxl, illustrious, pony | all-in-one checkpoint | baked in | STABLE_DIFFUSION | baked in | | Anima/Base | anima | anima-base-v1.0 | qwen_3_06b_base | STABLE_DIFFUSION | qwen_image_vae | | Krea2/Turbo | krea2 | krea2_turbo_fp8_scaled | qwen3vl_4b_fp8_scaled | KREA2 | qwen_image_vae | | ZImage/Base, ZImage/Turbo | zib, zit | z_image_turbo_bf16 | qwen_3_4b | LUMINA2 | ae.safetensors |

SDXL presets need only a Checkpoint. The other families ship as a bare diffusion model, so they also need a Text Encoder, its Text Encoder Type and a VAE. Point the preset at either a Checkpoint or a Diffusion Model — a UNET-only file that happens to live in models/checkpoints/ is detected automatically, so you don't have to move it.

Presets seed their sampler defaults from the family (Z-Image and Krea2 Turbo: 8 steps at CFG 1; Anima base: 30 steps at CFG 4). At CFG ≤ 1 the negative prompt is zeroed out, matching how distilled models are sampled. Clip Skip is hidden for the Qwen-based families, where it does not apply.

Anima, Krea2 and Z-Image require ComfyUI v0.34 or newer. Their architectures and the KREA2 encoder type do not exist in older releases.

ControlNets for Anima and Z-Image

A flake's ControlNet field works the same for every family: pick an image, a type, then tweak strength, start and end. Anima and Z-Image don't use regular ControlNets, though. Their ControlNets are model patches that hook the diffusion model, so the files go in models/model_patches/, not models/controlnet/:

| Family | Folder | Files | Types | |---|---|---|---| | Anima/Base | models/model_patches/anima/ | anima-lllite-{pose,depth,lineart,scribble}-1 (Comfy-Org/Anima-LLLite) | openpose, depth, lineart, scribble | | ZImage/Base, ZImage/Turbo | models/model_patches/zimage/ | Z-Image-Turbo-Fun-Controlnet-Union (any version) | openpose, depth, canny, softedge |

  • Anima depth expects a Depth Anything V2 map (white = near). The pose model is noticeably weaker than depth; for locking a pose, depth works better.
  • The Anima LLLite weights are Preview3 releases and lose some quality on Anima Base v1.0.
  • Z-Image's Fun ControlNet has no start/end: it applies to every step.
  • The base model is not reloaded when switching flakes. Each patch is a hook on a clone that shares its weights, and recently used patch files stay cached.

Nodes

Flake Stack

Sits between your checkpoint loader and sampler. Loads an ordered list of flakes (YAML presets), merges their prompts and LoRAs, and outputs everything the sampler needs.

Flake Stack demo

Flakes can be reordered, enabled / disabled, and edited. You can also open a small dropdown menu to make small non-persistent tweaks, such as changing a variant option, or a lora strength.

<div align="center">

Flake option dropdown

</div>

Flake Combo

TODO

Flake Model Preset

TODO

Flake Model Combo

TODO

Flake Generate

TODO

Flake Data Split

TODO


Roadmap

  • Flux support
  • Video support (Starting with WAN)
  • Post Process (ADetailler / Upscalers)
  • IP Adapters
  • LoRA training
  • Controlnet preprocessing
  • Variant LoRAs?

Fill free to open an issue if you'd like more features supported by Flakes.


Changelog

See CHANGELOG.md for the full release history.


License

MIT