fblissjr/llm-dit-experiments

experiments with autoregressive LLMs and DiT models

5

stars

742

commits

Python

primary language

Mar 31, 2026

updated

README

llm-dit-experiments

Multi-pipeline LLM-DiT generation platform. LLM hidden states -> flow-matching DiT -> VAE decode. Single GPU (24GB).

Backend: PyTorch, FastAPI, TOML config. Frontend: React 19, Vite 7, Bun (web/frontend-v2/).

Pipelines

PipelineTaskEncoderNotes
FLUX.2 Kleintext-to-image, image editingQwen3-8B/4BDistilled, multi-layer extraction, LoRA support
Z-Imagetext-to-image, img2imgQwen3-4BCFG=0 baked, 1504 token limit
LTX-2text-to-videoGemma3-12BPure PyTorch, FP8, persistent component caching
Qwen-Image-2512text-to-imageQwen2.5-VL-7B39GB transformer, requires fp8 on 24GB
Qwen-Image-Edit-2511image editing, multi-imageQwen2.5-VL-7BMulti-image composition, instruction editing

Quick Start

1. Backend

uv sync
cp config.toml.example config.toml   # edit model paths
uv run web/server.py --config config.toml

API on port 7860.

2. Frontend

cd web/frontend-v2
bun install
bun run dev

UI on http://localhost:5175. Vite proxies /api to the backend.

3. CLI (optional)

# Requires server running (step 1)
uv run scripts/gen.py flux2 --prompt "A photo of a cat" --seed 42

4. Batch Generation

Process a directory of images with the same prompt and model. Reads config.toml for server URL and default model.

# Basic -- uses config.toml defaults for server + model
uv run scripts/batch_flux2.py \
  --input-dir /path/to/images \
  --prompt "make this a watercolor painting"

# Override model, match output size to input
uv run scripts/batch_flux2.py \
  --input-dir /path/to/images \
  --output-dir /path/to/outputs \
  --prompt "transform this" \
  --model-name klein-9b-kv-fp8 \
  --match-image-size "0 (First Image)"

Supports resume -- interrupted runs skip already-completed images. Use --no-resume to regenerate all.

API

EndpointMethodDescription
/api/generatePOSTZ-Image generation
/api/flux2/generatePOSTFLUX.2 generation
/api/ltx2/generate/streamPOSTLTX-2 video (streaming)
/api/qwen-image/edit-layerPOSTSingle image editing
/api/qwen-image/edit-multiPOSTMulti-image composition
/api/qwen-image-2512/generatePOSTQwen-Image T2I
/api/models/{id}/loadPOSTLoad pipeline
/api/models/{id}/unloadPOSTUnload pipeline
/api/lorasGETList LoRAs
/api/config/sessionGET/PUTSession config
/api/rewritePOSTPrompt expansion
/healthGETHealth check

Experiments

Ablation sweeps and comparison tools in experiments/. See experiments/README.md.

Reference

Contributors

fblissjr

700 commits

claude

40 commits

fblissjr/llm-dit-experiments

experiments with autoregressive LLMs and DiT models

5

stars

742

commits

Python

primary language

Mar 31, 2026

updated

README

llm-dit-experiments

Multi-pipeline LLM-DiT generation platform. LLM hidden states -> flow-matching DiT -> VAE decode. Single GPU (24GB).

Backend: PyTorch, FastAPI, TOML config. Frontend: React 19, Vite 7, Bun (web/frontend-v2/).

Pipelines

PipelineTaskEncoderNotes
FLUX.2 Kleintext-to-image, image editingQwen3-8B/4BDistilled, multi-layer extraction, LoRA support
Z-Imagetext-to-image, img2imgQwen3-4BCFG=0 baked, 1504 token limit
LTX-2text-to-videoGemma3-12BPure PyTorch, FP8, persistent component caching
Qwen-Image-2512text-to-imageQwen2.5-VL-7B39GB transformer, requires fp8 on 24GB
Qwen-Image-Edit-2511image editing, multi-imageQwen2.5-VL-7BMulti-image composition, instruction editing

Quick Start

1. Backend

uv sync
cp config.toml.example config.toml   # edit model paths
uv run web/server.py --config config.toml

API on port 7860.

2. Frontend

cd web/frontend-v2
bun install
bun run dev

UI on http://localhost:5175. Vite proxies /api to the backend.

3. CLI (optional)

# Requires server running (step 1)
uv run scripts/gen.py flux2 --prompt "A photo of a cat" --seed 42

4. Batch Generation

Process a directory of images with the same prompt and model. Reads config.toml for server URL and default model.

# Basic -- uses config.toml defaults for server + model
uv run scripts/batch_flux2.py \
  --input-dir /path/to/images \
  --prompt "make this a watercolor painting"

# Override model, match output size to input
uv run scripts/batch_flux2.py \
  --input-dir /path/to/images \
  --output-dir /path/to/outputs \
  --prompt "transform this" \
  --model-name klein-9b-kv-fp8 \
  --match-image-size "0 (First Image)"

Supports resume -- interrupted runs skip already-completed images. Use --no-resume to regenerate all.

API

EndpointMethodDescription
/api/generatePOSTZ-Image generation
/api/flux2/generatePOSTFLUX.2 generation
/api/ltx2/generate/streamPOSTLTX-2 video (streaming)
/api/qwen-image/edit-layerPOSTSingle image editing
/api/qwen-image/edit-multiPOSTMulti-image composition
/api/qwen-image-2512/generatePOSTQwen-Image T2I
/api/models/{id}/loadPOSTLoad pipeline
/api/models/{id}/unloadPOSTUnload pipeline
/api/lorasGETList LoRAs
/api/config/sessionGET/PUTSession config
/api/rewritePOSTPrompt expansion
/healthGETHealth check

Experiments

Ablation sweeps and comparison tools in experiments/. See experiments/README.md.

Reference

Contributors

fblissjr

700 commits

claude

40 commits

Languages

Python

90.5%

TypeScript

7.4%

Shell

1.4%