Add a model
Start with a runner adapter. Implement the parallel methods that the model needs. Use FLUX.1-dev as an image-model reference and Z-Image as a CFG reference.
Runner adapter
- Subclass
xFuserModel. - Implement
_load_model()and_run_pipe(input_args). Return aDiffusionOutputfrom_run_pipe. - Register supported checkpoint names with
@register_model(...). The runner-model package imports its modules to populateMODEL_REGISTRY. - Declare
ModelCapabilities,DefaultInputValues, andModelSettings. Capabilities describe validation rules; execution code must implement each feature. - Set dependency requirements and
LoadSupportfor the loading routes you implement. - Add model-specific validation for restrictions that shared checks cannot express.
- Test defaults and each supported combination before enabling it.
Read the adapter contract, FLUX adapter, and adapter imports. FLUX's _load_model() selects different transformer and pipeline implementations for PipeFusion.
Parallel implementation
| Work | Guide | Current example |
|---|---|---|
| Sequence and attention partitioning | USP | FLUX.1-dev |
| Replicated condition tokens | Replicated text | FLUX.1-dev |
| Conditional/unconditional branch partitioning | CFG | Z-Image |
| Combined branch and sequence groups | CFG + USP | Z-Image |
| Transformer stages and patch scheduling | PipeFusion | FLUX.1-dev |
These guides explain implementation requirements and link to complete source. See framework design for runner adapters and component wrappers. See the runner guide for user commands.