Change8
Error7 reports

Fix UnboundLocalError

in Diffusers

Solution

The UnboundLocalError arises when a variable is used before it has been assigned a value within a specific scope (usually inside a function). To fix this, ensure the variable is assigned a value *before* it is used, potentially by initializing it with a default or checking a condition that determines its value before referencing it. Also verify that branching conditions (if/else statements) all lead to the variable being assigned.

Timeline

First reported:20h ago
Last reported:14h ago

Need More Help?

View the full changelog and migration guides for Diffusers

View Diffusers Changelog