Skip to content

fix: fix: correct attribute error in TangentialCFG and undefined variable in FrequencyDecoupledGuidance - #14512

Open
Ricardo-M-L wants to merge 1 commit into
huggingface:mainfrom
Ricardo-M-L:fix/guiders-attribute-and-variable-errors-clean
Open

fix: fix: correct attribute error in TangentialCFG and undefined variable in FrequencyDecoupledGuidance#14512
Ricardo-M-L wants to merge 1 commit into
huggingface:mainfrom
Ricardo-M-L:fix/guiders-attribute-and-variable-errors-clean

Conversation

@Ricardo-M-L

Copy link
Copy Markdown
Contributor

Clean rebase

…in FrequencyDecoupledGuidance

Fix two bugs in the guiders module:

1. TangentialClassifierFreeGuidance.is_conditional references
   `self._num_outputs_prepared` which does not exist. All other guiders
   use `self._count_prepared` (defined in BaseGuidance). This causes an
   AttributeError whenever is_conditional is accessed.

2. FrequencyDecoupledGuidance.forward uses `pred_cond_freq` in the else
   branch (line 278) where FDG is disabled for a level, but that variable
   is only defined inside the if branch. If the first pyramid level has
   FDG disabled, this raises a NameError. Even when a prior level defined
   it, the wrong level's data would be used. Fixed to use
   `pred_cond_pyramid[level]` which correctly indexes the pyramid.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added guiders size/S PR with diff < 50 LOC labels Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi @Ricardo-M-L, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. Fixes #1234) to the PR description so the issue is linked. See the contribution guide for more details. If this PR intentionally does not fix a tracked issue, a maintainer can add the no-issue-needed label to silence this reminder.

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

Labels

guiders size/S PR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant