Skip to content

Fix Ideogram 4 Callback Handling and Tests - #14621

Open
dg845 wants to merge 1 commit into
mainfrom
ideogram-4-fix-callback-kwargs
Open

Fix Ideogram 4 Callback Handling and Tests#14621
dg845 wants to merge 1 commit into
mainfrom
ideogram-4-fix-callback-kwargs

Conversation

@dg845

@dg845 dg845 commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

This PR fixes a bug in Ideogram4Pipeline.__call__ where a dict comprehension was used to get callback_kwargs. On Python versions before 3.12 (PEP 709), this means that callback_kwargs doesn't correctly get local variables like latents. The PR fixes this by using the standard for loop pattern used by most other pipelines (e.g. Flux 2), which works on all Python versions:

if callback_on_step_end is not None:
callback_kwargs = {}
for k in callback_on_step_end_tensor_inputs:
callback_kwargs[k] = locals()[k]
callback_outputs = callback_on_step_end(self, i, t, callback_kwargs)

It also unskips the Ideogram 4 callback tests, which pass after the fix.

Fixes #14617

Before submitting

  • Did you use an AI agent (Claude Code, Codex, Cursor, etc.) to help with this PR? If so:
    • Did you read the Coding with AI agents guide?
    • Did you run the self-review skill on the diff?
    • Did you share the final self-review notes in the PR description or a comment?
  • Did you read the contributor guideline?
  • Did you read our philosophy doc? (important for complex PRs)
  • Was this discussed/approved via a GitHub issue or the forum? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?
  • Are you the author (or part of the team) of the model/pipeline (only applicable for model/pipeline related PRs)?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@sayakpaul
@DN6

@sayakpaul sayakpaul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go!

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.

It looks like most other pipelines such as Flux 2 use the following callback_kwargs pattern instead of a dict comprehension:

2 participants