metadata
license: mit
base_model: black-forest-labs/FLUX.2-klein-9B
tags:
- lora
- flux
- flux.2
- flux.2-klein-9b
- image-to-image
- text-to-image
- font
- typography
- atlas
- comfyui
- safetensors
Ref2FontV1 — Contextual LoRA for FLUX.2 Klein 9B
Ref2FontV1 is a contextual LoRA trained for black-forest-labs/FLUX.2-klein-9B. It generates 1024×1024 font atlases from a single reference image, following the same layout as the provided examples.
Disclaimer: it works well, but not perfectly. Expect occasional artifacts and minor alignment issues.
Examples
Guide
The full usage, installation guide and detailed workflow live in the GitHub repo:
https://github.com/SnJake/Ref2Font
What’s included
Ref2FontV1.safetensors(LoRA weights)Example Workflow/(ComfyUI workflow with notes inside nodes)Example/(input images and their atlases)- Post-processing scripts (
flux_pipeline.py,flux_grid_to_ttf.py,flux_upscale.py)
License
MIT
ComfyUI setup
Required models
- Base model:
https://huggingface.co/black-forest-labs/FLUX.2-klein-9B/blob/main/flux-2-klein-9b.safetensors
Place in: ComfyUI/models/diffusion_models
- Text encoder (Qwen):
https://huggingface.co/Comfy-Org/vae-text-encorder-for-flux-klein-9b/blob/main/split_files/text_encoders/qwen_3_8b.safetensors
Place in: ComfyUI/models/text_encoders
- VAE:
https://huggingface.co/Comfy-Org/vae-text-encorder-for-flux-klein-9b/blob/main/split_files/vae/flux2-vae.safetensors
Place in: ComfyUI/models/vae
LoRA
Download:
https://huggingface.co/SnJake/Ref2Font/blob/main/Ref2FontV1.safetensors
Place in: ComfyUI/models/loras
Input image rules
- Strict black & white only (no gray, no shadows, no volume)
- 1024×1024 exactly
- Follow the examples in
Example/
Post-processing: Atlas → TTF
Use the included pipeline script to convert the atlas into a TTF.
Example command (Windows)
python "Flux 2 Klein 9B\flux_pipeline.py" ^
--input "D:\ComfyUI_temp_nckhb_00003_.png" ^
--output-dir "G:\Flux 2 Klein 9B\test" ^
--no-upscale ^
--use-grid ^
--vectorize contours ^
--simplify 0.5 ^
--canvas 1024 ^
--contour-level 0.5 ^
--trace-scale 4 ^
--trace-blur 1.0 ^
--smooth-iters 2 ^
--baseline-mode auto ^
--baseline-quantile 0.9 ^
--baseline-min-pixels 20 ^
--cols 8 ^
--rows 9 ^
--no-auto-invert
Upscaler is optional. If you want to use flux_upscale.py, install PyTorch separately:
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
Notes
- The upscaler is optional; you can skip it with
--no-upscale. - The optional upscaler is also hosted in this HF repo:
https://huggingface.co/SnJake/Ref2Font
- If the atlas looks inverted, try removing
--no-auto-invertor add--invert. - If letters look vertically misaligned, use
--baseline-mode auto.


