vdaular's picture
|
download
raw
4.27 kB
# FLUX.2 & Klein 9B RefMods (Reference Latent Adapters)
Open research, architecture documentation, and implementation repository for **FLUX.2 & Klein 9B RefMods**.
- **Interactive Model Browser:** [https://huggingface.co/spaces/malcolmrey/browser](https://huggingface.co/spaces/malcolmrey/browser) (Search & visually explore 1,400+ characters, celebrities, and concepts)
- **Model Weights Hub:** [https://huggingface.co/malcolmrey/klein9](https://huggingface.co/malcolmrey/klein9) (1,400+ pre-extracted `.safetensors` models)
- **ComfyUI Custom Node:** [github.com/malcolmamal/ComfyUI-Flux2Klein9Mod](https://github.com/malcolmamal/ComfyUI-Flux2Klein9Mod)
- **CLI Generator & Batch Extractor:** [`generate_flux2_klein9_refmod.py`](generate_flux2_klein9_refmod.py)
- **Official Workflows:** [`workflows/`](workflows/) ([`workflow_klein9_refmod.json`](workflows/workflow_klein9_refmod.json) & [`workflow_klein9_refmod_lora.json`](workflows/workflow_klein9_refmod_lora.json))
- **Target Models:** FLUX.2, Klein 4B, Klein 8B, Klein 9B
---
## ๐Ÿ“ Repository Structure
```text
klein9/
โ”œโ”€โ”€ generate_flux2_klein9_refmod.py <โ”€โ”€ CLI Generator & Mass Batch Extractor Tool
โ”œโ”€โ”€ workflows/ <โ”€โ”€ Mirrored Production Workflows
โ”‚ โ”œโ”€โ”€ workflow_klein9_refmod.json <โ”€โ”€ Pure RefMod Text-to-Image Workflow
โ”‚ โ””โ”€โ”€ workflow_klein9_refmod_lora.json <โ”€โ”€ Hybrid RefMod + LoRA Power Stack Workflow
โ”œโ”€โ”€ docs/
โ”‚ โ”œโ”€โ”€ README.md <โ”€โ”€ Documentation Index
โ”‚ โ”œโ”€โ”€ FLUX2_KLEIN9_REFMODS_GUIDE.md <โ”€โ”€ Complete Architecture, Extraction & Usage Guide
โ”‚ โ”œโ”€โ”€ VISUAL_BENCHMARKS_AND_COMPARISONS.md <โ”€โ”€ 5-Column Visual Benchmarks & Single Run Links
โ”‚ โ””โ”€โ”€ examples/ <โ”€โ”€ Benchmark Grids & Single Run Artifacts (PNGs)
โ””โ”€โ”€ comfyui/
โ””โ”€โ”€ custom_nodes/
โ””โ”€โ”€ ComfyUI-Flux2Klein9Mod/ <โ”€โ”€ Full ComfyUI Custom Node Package
```
---
## ๐Ÿš€ Quickstart
### 1. Install ComfyUI Custom Node
```bash
cd ComfyUI/custom_nodes
git clone https://github.com/malcolmamal/ComfyUI-Flux2Klein9Mod.git
```
### 2. Discover & Download RefMods
Search and find any character, celebrity, or concept `.safetensors` in the [Malcolmrey Browser Space](https://huggingface.co/spaces/malcolmrey/browser) or directly on the [Hugging Face Hub](https://huggingface.co/malcolmrey/klein9), then place the file into:
```text
ComfyUI/models/refmods-klein9/
```
### 3. Load Ready-to-Use Workflows
Load either of the official JSON workflows located in [`workflows/`](workflows/):
- **[`workflow_klein9_refmod.json`](workflows/workflow_klein9_refmod.json):** Pure RefMod Text-to-Image generation for FLUX.2 / Klein 9B.
- **[`workflow_klein9_refmod_lora.json`](workflows/workflow_klein9_refmod_lora.json):** Hybrid RefMod + LoRA Power Stack.
### 4. Extract Custom RefMods from Datasets
Use the included generator script [`generate_flux2_klein9_refmod.py`](generate_flux2_klein9_refmod.py):
```bash
# Extract single dataset by name or path
python generate_flux2_klein9_refmod.py C:/Development/ai-toolkit/datasets/your_character --token-budget 1024
# Preview media discovered without encoding
python generate_flux2_klein9_refmod.py your_character --dry-run
# Mass batch extract all datasets in directory
python generate_flux2_klein9_refmod.py --all --datasets-root C:/Development/ai-toolkit/datasets
```
---
## ๐Ÿ“– Complete Documentation & Visual Studies
- **[Interactive Model Browser](https://huggingface.co/spaces/malcolmrey/browser)**: Live visual model finder with search and filter capabilities.
- **[FLUX.2 & Klein 9B RefMods Architecture Guide](docs/FLUX2_KLEIN9_REFMODS_GUIDE.md)**: Node specifications, graph wiring diagrams, token budget configurations, and extraction mechanics.
- **[Visual Benchmarks & 5-Column Comparison Studies](docs/VISUAL_BENCHMARKS_AND_COMPARISONS.md)**: Side-by-side empirical visual comparisons (Pure LoRA vs 8-Raw Reference vs Pure RefMod vs Hybrid stack) with direct links to high-res single runs and model weights on Hugging Face.
- **[CLI Generator Script](generate_flux2_klein9_refmod.py)**: Source code for dataset pre-encoding and batch processing.

Xet Storage Details

Size:
4.27 kB
ยท
Xet hash:
e3dd0281ab4b2e66af3e1622edf0848d5320f162a73e9d201367697aedf001d1

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.