Skip to content

Commit 7c93dd0

Browse files
committed
add warning in doc on providing prompts
1 parent df49440 commit 7c93dd0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/diffusers/pipelines/flux/pipeline_flux_prior_redux.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ def __call__(
392392
list of arrays, the expected shape should be `(B, H, W, C)` or `(H, W, C)`
393393
prompt (`str` or `List[str]`, *optional*):
394394
The prompt or prompts to guide the image generation.
395+
**experimental feature**: to use this feature, make sure to explicitly load text encoders to
396+
the pipeline. Prompts will be ignored if text encoders are not loaded.
395397
prompt_2 (`str` or `List[str]`, *optional*):
396398
The prompt or prompts to be sent to the `tokenizer_2` and `text_encoder_2`.
397399
prompt_embeds (`torch.FloatTensor`, *optional*):
@@ -459,6 +461,11 @@ def __call__(
459461
lora_scale=None,
460462
)
461463
else:
464+
if prompt is not None:
465+
logger.warning(
466+
"prompt input is ignored when text encoders are not loaded to the pipeline. "
467+
"Make sure to explicitly load the text encoders to enable prompt input. "
468+
)
462469
# max_sequence_length is 512, t5 encoder hidden size is 4096
463470
prompt_embeds = torch.zeros((batch_size, 512, 4096), device=device, dtype=image_embeds.dtype)
464471
# pooled_prompt_embeds is 768, clip text encoder hidden size

0 commit comments

Comments
 (0)