> ## Documentation Index
> Fetch the complete documentation index at: https://runinfra.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Image generation optimization runbook

> How RunInfra evaluates image generation optimizations for diffusion and DiT pipelines, including precision, compilation, scheduler choice, step distillation, quality gates, and rollback controls.

## Optimization stack

| Technique                              | Applies when                                | Benefit                                                    | Availability                                           |
| -------------------------------------- | ------------------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------ |
| FP8 W8A8 dynamic precision             | Ada, Hopper, and Blackwell GPUs             | Higher image throughput when quality gates pass            | Available on supported deployments                     |
| torch.compile reduce-overhead mode     | Hopper or newer GPUs with large DiT models  | Lower per-image latency on compatible pipelines            | Core                                                   |
| Family-aware scheduler selection       | FLUX, SD3, SDXL, and compatible families    | Better speed and quality tradeoff than a generic scheduler | Available on supported deployments                     |
| Step-distillation LoRA                 | Non-distilled FLUX-Dev, SDXL, and SD3 bases | Fewer denoising steps with quality guardrails              | Core                                                   |
| TAESD and tiled VAE                    | Memory-constrained image pipelines          | Lower memory pressure during decode                        | Available on supported deployments                     |
| Attention and feature-cache techniques | DiT workloads with compatible runtimes      | Additional speedups after validation                       | Evaluated when model and runtime support are available |

## Quality gates

| Metric           | Required result                                                 |
| ---------------- | --------------------------------------------------------------- |
| FID delta        | Less than 5.0 versus the baseline reference set                 |
| CLIP score delta | Greater than -0.02 versus the baseline                          |
| PickScore        | Greater than 0.45                                               |
| Image integrity  | Output images parse successfully and match requested dimensions |

Quality gates must pass before RunInfra treats a faster image-generation variant as deployable. If quality evidence is missing or fails, the dashboard keeps the safer baseline path.

For backend lab evidence, `image_semantic_alignment` must come from an explicit measured semantic gate (`qualityGate.measured=true`). Numeric CLIP or semantic scores without that measured marker stay audit metadata and cannot support promotion.

## How RunInfra applies image optimizations

| Decision               | What RunInfra checks                             | Runtime effect                                                                 |
| ---------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------ |
| Dynamic precision      | GPU family, model support, and quality results   | Uses FP8 only when the measured candidate stays within quality limits          |
| Compilation mode       | Model family, GPU support, and compile stability | Enables reduce-overhead compilation only for compatible deployments            |
| Scheduler selection    | Model family and requested generation behavior   | Selects a scheduler matched to FLUX, SD3, SDXL, or the detected family         |
| Step distillation      | Base model family, plan tier, and quality gates  | Uses the validated step-distillation adapter for eligible non-distilled models |
| Decode memory controls | Requested image size and available GPU memory    | Applies lower-memory decode paths when they are needed for reliability         |

## Verification

1. The optimization plan should explain which image techniques were accepted, skipped, or rejected.
2. Benchmark results should include per-image latency, peak VRAM, and the relevant image-quality gates.
3. Deployment settings should match the winning measured variant shown in the dashboard.
4. The endpoint test should generate a valid image at the requested size before the deployment is treated as ready.

## Rollback

Use customer overrides when you want a safer baseline or need to isolate a production issue:

```ts theme={"dark"}
constraints.customerOverrides = {
  skipTechniques: ["compile"],
};

constraints.customerOverrides = {
  forceQuant: "none",
};
```

## Availability notes

* Image optimizations are shown as deployable only after the selected model, GPU, and runtime support the technique.
* Step-distillation support depends on the base model family and the validated adapter for that family.
* Multi-adapter image workloads may require a custom deployment review because not every runtime supports stacking multiple LoRA adapters efficiently.
* Techniques under evaluation stay out of generated deployment snippets until RunInfra can carry their measured settings into the endpoint reliably.
