Spaces:
Runtime error
Runtime error
Update pipeline.py
Browse files- pipeline.py +3 -3
pipeline.py
CHANGED
|
@@ -622,7 +622,7 @@ class FluxWithCFGPipeline(DiffusionPipeline, FluxLoraLoaderMixin, FromSingleFile
|
|
| 622 |
hidden_states=latent_model_input,
|
| 623 |
timestep=timestep / 1000,
|
| 624 |
guidance=guidance,
|
| 625 |
-
pooled_projections=pooled_prompt_embeds,
|
| 626 |
encoder_hidden_states=prompt_embeds,
|
| 627 |
txt_ids=text_ids,
|
| 628 |
img_ids=latent_image_ids,
|
|
@@ -633,7 +633,7 @@ class FluxWithCFGPipeline(DiffusionPipeline, FluxLoraLoaderMixin, FromSingleFile
|
|
| 633 |
hidden_states=latents,
|
| 634 |
timestep=timestep / 1000,
|
| 635 |
guidance=guidance,
|
| 636 |
-
pooled_projections=negative_pooled_prompt_embeds,
|
| 637 |
encoder_hidden_states=negative_prompt_embeds,
|
| 638 |
txt_ids=negative_text_ids,
|
| 639 |
img_ids=latent_image_ids,
|
|
@@ -642,7 +642,7 @@ class FluxWithCFGPipeline(DiffusionPipeline, FluxLoraLoaderMixin, FromSingleFile
|
|
| 642 |
)[0]
|
| 643 |
|
| 644 |
if self.do_classifier_free_guidance:
|
| 645 |
-
noise_pred_uncond, noise_pred_text = noise_pred.chunk(
|
| 646 |
noise_pred = noise_pred_uncond + self._guidance_scale * (noise_pred_text - noise_pred_uncond)
|
| 647 |
else: noise_pred = noise_pred_uncond + self._guidance_scale * (noise_pred_text - noise_pred_uncond)
|
| 648 |
|
|
|
|
| 622 |
hidden_states=latent_model_input,
|
| 623 |
timestep=timestep / 1000,
|
| 624 |
guidance=guidance,
|
| 625 |
+
pooled_projections=pooled_prompt_embeds.shape[1],
|
| 626 |
encoder_hidden_states=prompt_embeds,
|
| 627 |
txt_ids=text_ids,
|
| 628 |
img_ids=latent_image_ids,
|
|
|
|
| 633 |
hidden_states=latents,
|
| 634 |
timestep=timestep / 1000,
|
| 635 |
guidance=guidance,
|
| 636 |
+
pooled_projections=negative_pooled_prompt_embeds.shape[1],
|
| 637 |
encoder_hidden_states=negative_prompt_embeds,
|
| 638 |
txt_ids=negative_text_ids,
|
| 639 |
img_ids=latent_image_ids,
|
|
|
|
| 642 |
)[0]
|
| 643 |
|
| 644 |
if self.do_classifier_free_guidance:
|
| 645 |
+
noise_pred_uncond, noise_pred_text = noise_pred.chunk(0)
|
| 646 |
noise_pred = noise_pred_uncond + self._guidance_scale * (noise_pred_text - noise_pred_uncond)
|
| 647 |
else: noise_pred = noise_pred_uncond + self._guidance_scale * (noise_pred_text - noise_pred_uncond)
|
| 648 |
|