Skip to content

fix: undefined variable in conditioning warning#751

Open
Mr-Neutr0n wants to merge 1 commit intolllyasviel:mainfrom
Mr-Neutr0n:fix/undefined-variable-cbs-warning
Open

fix: undefined variable in conditioning warning#751
Mr-Neutr0n wants to merge 1 commit intolllyasviel:mainfrom
Mr-Neutr0n:fix/undefined-variable-cbs-warning

Conversation

@Mr-Neutr0n
Copy link

Bug

Variable cbs is referenced in a warning message but not defined in that scope, causing a NameError when the warning is triggered.

In both cldm/ddim_hacked.py and ldm/models/diffusion/ddim.py, the elif isinstance(conditioning, list) branch references cbs in its warning print statement, but cbs is only defined in the preceding if isinstance(conditioning, dict) branch. When conditioning is a list and a batch size mismatch occurs, this raises a NameError.

Fix

Replaced cbs with ctmp.shape[0] in the list conditioning branch, which is the correct value from the loop variable already being checked in the condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant