Skip to content

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

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

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

@Ricardo-M-LRicardo-M-L commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes#14643 - two crash bugs in the guiders:

  1. TangentialCFG.is_conditional references the nonexistent self._num_outputs_prepared (AttributeError) - the attribute is self._count_prepared.
  2. FrequencyDecoupledGuidance.forward uses the undefined name pred_cond_freq in the non-FDG branch (NameError) - should be pred_cond_pyramid[level].

+2/-2 across 2 files, no API changes.

Rebase of #13434. Fixes#14643.

…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-actionsgithub-actionsBot 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.

@github-actions

github-actionsBot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Hi @Ricardo-M-L, a follow-up on the reminder above: this PR still does not link an issue it fixes.

Please note that PRs without a linked issue are likely to be automatically closed 10 days after this notice. Adding a closing keyword (e.g. Fixes #1234) to the PR description, or a maintainer adding the no-issue-needed label, will prevent that.

@yiyixuxu

yiyixuxu commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

hi @Ricardo-M-L

I'm closing this per the AI-assisted contribution guidelines: https://huggingface.co/docs/diffusers/main/en/conceptual/contribution#ai-assisted-and-agentic-contributions

We're seeing an increasing volume of contributions and review capacity is currently our bottleneck, so the guidelines ask for maintainer acknowledgment on an issue before a PR is opened — that lets us prioritize the bugs users are actually hitting.

Normally we'd leave this as a suggestion and keep working with a contributor on the PR, but the volume here has made that impractical — these have come in faster than we can review them, so I'm closing all of them that you've opened rather than reviewing them individually.

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

Labels

guiderssize/SPR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: AttributeError in TangentialCFG.is_conditional and NameError in FrequencyDecoupledGuidance.forward

2 participants

@Ricardo-M-L@yiyixuxu