Fix: allow Flux Fill pipeline to skip image preprocessing when latents are provided

Fix a bug in the Flux Fill pipeline where \`image\` was implicitly required even when
\`latents\` and \`masked_image_latents\` were directly passed.

When both \`latents\` and \`masked_image_latents\` are given, preprocessing the \`image\`
is unnecessary. The previous implementation assumed \`image\` was always provided,
causing errors or redundant preprocessing.

Changes:
- Added conditional check to skip image preprocessing when \`image\` is None
- Allows \`latents\`-only inputs to run successfully
- Improves consistency with other pipelines
This commit is contained in:
Xingfu Yi
2025-11-11 02:09:03 +00:00
parent 5a47442f92
commit 9497933686
@@ -890,8 +890,11 @@ class FluxFillPipeline(
self._joint_attention_kwargs = joint_attention_kwargs self._joint_attention_kwargs = joint_attention_kwargs
self._interrupt = False self._interrupt = False
init_image = self.image_processor.preprocess(image, height=height, width=width) if image:
init_image = init_image.to(dtype=torch.float32) init_image = self.image_processor.preprocess(image, height=height, width=width)
init_image = init_image.to(dtype=torch.float32)
else:
init_image = None
# 2. Define call parameters # 2. Define call parameters
if prompt is not None and isinstance(prompt, str): if prompt is not None and isinstance(prompt, str):