Skip to content

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

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

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

Conversation

@Ricardo-M-L

Copy link
Copy Markdown
Contributor

This PR addresses: correct attribute error in TangentialCFG and undefined variable in FrequencyDecoupledGuidance

…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 size/S PR with diff < 50 LOC guiders and removed 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant