# Chroma Workflow Recipe

Use this when you want the app to batch prompts through a local ComfyUI Chroma workflow with `chroma-unlocked-v50.safetensors`.

## What to download

1. Chroma checkpoint:
   - `chroma-unlocked-v50.safetensors`
   - source: https://huggingface.co/lodestones/Chroma/blob/main/chroma-unlocked-v50.safetensors

2. T5 XXL text encoder:
   - one of the `t5xxl` encoder files used by Flux/Chroma workflows
   - official Chroma workflow example points to:
     `https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp16.safetensors`
     or
     `https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp8_e4m3fn_scaled.safetensors`

3. VAE:
   - `ae.safetensors`
   - official Chroma workflow example points to:
     `https://huggingface.co/Comfy-Org/Lumina_Image_2.0_Repackaged/resolve/main/split_files/vae/ae.safetensors`

4. Official example workflow:
   - `ComfyUI_Chroma1-HD_T2I-workflow.json`
   - source: https://huggingface.co/lodestones/Chroma/blob/main/ComfyUI_Chroma1-HD_T2I-workflow.json

## Where to put the files

For the current official Chroma workflow JSON:

- put `chroma-unlocked-v50.safetensors` in `ComfyUI/models/diffusion_models/`
- put the `t5xxl` encoder file in `ComfyUI/models/text_encoders/`
- put `ae.safetensors` in `ComfyUI/models/vae/`

Note:
- the older Chroma model card mentions `ComfyUI/models/clip` for T5
- the newer official workflow JSON points to `text_encoders`
- if your workflow expects a different folder, follow the workflow

## What to set in the app

In Exocortex MediaForge:

1. Set `Engine` to `comfyui`
2. Set `Mode` to `image`
3. Set `Preset` to `Chroma-unlocked v50`
4. Set `Server URL` to your local ComfyUI server, usually `http://127.0.0.1:8188`
5. Pick your saved API-format workflow JSON
6. Leave `Expected Output` as `png`
7. Click `Refresh Models`
8. Choose `diffusion_models`
9. Set `Model Override` to `chroma-unlocked-v50.safetensors`

## Recommended node fields

If you use the official Chroma workflow as the base:

- `Model Node`: `UNETLoader`
- `Model Input`: `model_name`
- `Prompt Node`: `CLIP Text Encode (Positive Prompt)`
- `Prompt Input`: `text`
- `Negative Prompt Node`: `CLIP Text Encode (Negative Prompt)`
- `Negative Prompt Input`: `text`

If those titles do not resolve in your copy:

- use the exact node ids from your workflow instead
- the app accepts either node ids or matching node titles

## Practical defaults

- start with square prompts around `1024x1024`
- keep the workflow's own sampler and steps at first
- test a single prompt in ComfyUI directly before running a batch in the app
- once the workflow renders one good image, the app can handle the batch, filenames, manifest, and retry flow

## Why this is slightly manual

Chroma is Flux-based, so the workflow still owns the real render graph:

- model loader
- text encoder wiring
- VAE
- sampler
- steps
- resolution
- save node

The app just handles:

- prompt batching
- prompt replacement
- model override
- output naming
- manifest/log writing
- retry support

## Sources

- Chroma Diffusers docs: https://huggingface.co/docs/diffusers/en/api/pipelines/chroma
- Chroma checkpoint file: https://huggingface.co/lodestones/Chroma/blob/main/chroma-unlocked-v50.safetensors
- Official Chroma workflow JSON: https://huggingface.co/lodestones/Chroma/blob/main/ComfyUI_Chroma1-HD_T2I-workflow.json
