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:
@@ -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
|
||||||
|
|
||||||
|
if image:
|
||||||
init_image = self.image_processor.preprocess(image, height=height, width=width)
|
init_image = self.image_processor.preprocess(image, height=height, width=width)
|
||||||
init_image = init_image.to(dtype=torch.float32)
|
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):
|
||||||
|
|||||||
Reference in New Issue
Block a user