aredden / flux-fp8-api

Flux diffusion model implementation using quantized fp8 matmul & remaining layers use faster half precision accumulate, which is ~2x faster on consumer devices.
Apache License 2.0
209 stars 22 forks source link

[bug]UnboundLocalError: cannot access local variable 'temp_77_token_ids' where it is not associated with a value #23

Closed 81549361 closed 1 month ago

81549361 commented 1 month ago

This error occurs with some prompts

  File "/root/flux-api/flux_emphasis.py", line 364, in get_weighted_text_embeddings_flux
    prompt_tokens_t5_grouped, prompt_weights_t5_grouped = group_tokens_and_weights(
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/flux-api/flux_emphasis.py", line 226, in group_tokens_and_weights
    new_token_ids.append(temp_77_token_ids)
                         ^^^^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'temp_77_token_ids' where it is not associated with a value

prompt

In a medium shot from a slightly elevated angle, a man and woman stand on a lively street adorned with Halloween decorations, embodying the spirit of trick-or-treating. The woman, dressed as a whimsical witch, wears a flowing black dress with shimmering silver accents, complete with a pointed hat perched jauntily on her long, wavy auburn hair. Her makeup is dramatic, featuring dark eyeliner and a splash of glitter, giving her a playful yet enchanting appearance. Beside her, the man sports a classic vampire costume, complete with a sleek black cape and a fitted white shirt, accentuated by a red satin vest. His slicked-back dark hair and pale makeup, highlighted by a fake blood drip at the corner of his mouth, complete the look, enhancing his mischievous grin. The background captures a festive neighborhood scene, with houses elaborately decorated in Halloween themes  jack-o'-lanterns glowing on doorsteps, cobwebs draped across fences, and colorful lights twinkling in the evening twilight. The warm glow of streetlights mingles with the soft hues of dusk, creating an inviting atmosphere filled with anticipation and excitement. Trick-or-treaters of various ages can be seen in the background, adding to the festive vibe, while the scattered leaves on the ground hint at the autumn season. The overall color palette combines deep oranges, blacks, and purples, enhancing the Halloween spirit. The image is sharp and clear, capturing every detail of the costumes and the enchanting atmosphere of the Halloween festivities
aredden commented 1 month ago

Ah- I'll look into this, thanks :)

aredden commented 1 month ago

This commit should fix your issue 0a914297d17f58f64214e1f99d8d3cfb9e791d3e