invoke-ai/InvokeAI · error · ValueError
fill_conditioning was provided, but the model is not a FLUX
Error message
fill_conditioning was provided, but the model is not a FLUX Fill model.
What it means
fill_conditioning (e.g. an inpaint mask/image used for FLUX Fill inpainting) is only consumed by FLUX Fill (DevFill variant) transformers. If the loaded transformer is not the DevFill variant, providing fill_conditioning is a configuration mistake, so the invocation raises instead of silently ignoring the conditioning.
Source
Thrown at invokeai/app/invocations/flux_denoise.py:354
assert noise is not None
x = noise
# If len(timesteps) == 1, then short-circuit. We are just noising the input latents, but not taking any
# denoising steps.
if len(timesteps) <= 1:
return x
if is_schnell and self.control_lora:
raise ValueError("Control LoRAs cannot be used with FLUX Schnell")
# Prepare the extra image conditioning tensor (img_cond) for either FLUX structural control or FLUX Fill.
img_cond: torch.Tensor | None = None
is_flux_fill = transformer_config.variant is FluxVariantType.DevFill
if is_flux_fill:
img_cond = self._prep_flux_fill_img_cond(context, device=device, dtype=inference_dtype)
else:
if self.fill_conditioning is not None:
raise ValueError("fill_conditioning was provided, but the model is not a FLUX Fill model.")
if self.control_lora is not None:
img_cond = self._prep_structural_control_img_cond(context)
inpaint_mask = self._prep_inpaint_mask(context, x)
img_ids = generate_img_ids(h=latent_h, w=latent_w, batch_size=b, device=x.device, dtype=x.dtype)
# Pack all latent tensors.
init_latents = pack(init_latents) if init_latents is not None else None
inpaint_mask = pack(inpaint_mask) if inpaint_mask is not None else None
noise = pack(noise)
x = pack(x)
# Now that we have 'packed' the latent tensors, verify that we calculated the image_seq_len, packed_h, and
# packed_w correctly.
assert packed_h * packed_w == x.shape[1]
View on GitHub (pinned to 0b6a024f2f)
Solutions
- Load/select a FLUX Fill (DevFill variant) model in the model loader feeding the denoise invocation.
- Remove the fill_conditioning input if inpainting via FLUX Fill is not intended (use the inpaint_mask field for regular masking instead).
- Verify the transformer config variant is FluxVariantType.DevFill before connecting fill_conditioning.
Example fix
// before denoise.fill_conditioning = fillMaskField; // model is plain FLUX Dev // after denoise.fill_conditioning = null; // or load a FLUX Fill model instead
Defensive patterns
Strategy: validation
Validate before calling
if denoise.fill_conditioning is not None and model_config.variant != FluxVariantType.DevFill:
raise ValueError("fill_conditioning requires a FLUX Fill (DevFill) model") Type guard
def supports_fill_conditioning(config) -> bool:
return getattr(config, 'variant', None) == FluxVariantType.DevFill Try / catch
try:
result = invoke(denoise)
except ValueError as e:
if 'not a FLUX Fill model' in str(e):
denoise.fill_conditioning = None # fall back to no fill conditioning
result = invoke(denoise)
else:
raise Prevention
- Load a DevFill-variant model whenever fill_conditioning is wired
- Use inpaint_mask for generic inpainting instead of fill_conditioning on non-Fill models
- Check transformer config.variant before connecting conditioning inputs
When it happens
Trigger: Passing a non-null fill_conditioning field to FLUX Denoise while the loaded transformer's config.variant is any FluxVariantType other than DevFill (e.g. Dev, Schnell, Kontext).
Common situations: User wires an inpaint/fill conditioning input but the model selector points at a regular FLUX Dev checkpoint instead of a FLUX Fill model; model was upgraded/replaced and the fill model is no longer loaded; workflow copied from a FLUX Fill example with a different model chosen.
Related errors
- Control LoRAs cannot be used with FLUX Schnell
- Initial latents are required when using an inpaint mask (ima
- A VAE (e.g., controlnet_vae) must be provided to use Kontext
- Unsupported model format: {config.format}
- Unsupported cfg_scale type: {type(cfg_scale)}
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/1891c5cdf3780ae2.
Report an issue: GitHub.