Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): flux redux canvas #7752

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

psychedelicious
Copy link
Collaborator

Summary

Add support for FLUX Redux on Canvas. Choose a FLUX Redux model in a Global or Regional Reference Image layer to use it.

I made a breaking change to the flux_redux node, removing the SigLIP model field (node version bumped to 2.0.0 to account for this).

We don't think there will ever be a choice of SigLIP models, so to make the UX smoother, we will hardcode it and handle it like we do for CLIP Vision models:

  • Include in starter models (as a dependency of the FLUX Redux model)
  • When executing the flux_redux node, if the model is not available, attempt to download it on the spot w/ a 10min timeout and warning in the logs
  • If, after the 10 min, we still don't have the model, the node will error and fail

Related Issues / Discussions

n/a

QA Instructions

  • Try out FLUX Redux in Canvas - global and regional.
  • Switch between FLUX Redux and IP Adapter on Global Ref Image layers.
  • Regional Ref Image Layers should not allow you to choose FLUX IP Adapter but FLUX Redux should be an option.

Note: It looks like Redux almost totally nullifies text conditioning. I'm not sure if this is expected, but I think @hipsterusername noticed the same thing.

Regions seem to be a bit less strict with FLUX Redux than SDXL IP Adapter. With SDXL IP Adapter, you can get starkly contrasting styles right next to each other. For example, a watercolor-like subject on photograph-like background. I'm having trouble achieving this with Redux. Not suggesting this is a problem - it's different tech, after all - just noting it.

Merge Plan

n/a

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

…we cannot find it

This follows the same pattern for IP Adapter w/ its CLIP Vision model. The SigLIP model is unlikely to ever change and we don't want to force the user to select it anywhere. Hardcoding it is safe and makes the UX much nicer.

The alternative is a model dropdown that will likely only ever have one valid choice in it.
User facing:

When a FLUX main model is selected, users may now add Regional Reference Image layers.

When switching between FLUX Redux and FLUX IP Adapter, the settings will change to match the model type. (IP Adapter has weight, begin/end step, but Redux does not.) The image will be retained when switching between the two.

Otherwise it works the same way as IP Adapter - both in Global and Regional Reference Image layers.

---

Internal state handling:

Slightly awkward, but it was easiest to make FLUX Redux a second type of IP Adapter in redux state.

Global and regional reference images still have a single `ipAdapter` field, but it can have a type of `ip_adapter` or `flux_redux`.

Ideally, this field is called `config` or `settings` or something, but we are past that point. We _could_ do a migration to rename it, but I don't think it's worth the effort.

---

Other changes:
- Updated canvas layer validators to handle FLUX Redux.
- Updated model list loading logic to un-set FLUX Redux models in Canvas if they are not in the list (e.g. if the user deletes the model in the main app).
- Updated graph builders - new `addFLUXRedux` util & updated `addRegions` util.
- Updated the `buildModelsHook` util to return a hook that accepts a filter callback. This handles a discrepancy: FLUX IP Adapter does not support regional guidance, but FLUX Redux does. The Regional Guidance settings provide the filter to filter out FLUX IP Adapter models from the combined list of IP Adapter ahd Redux models.
@github-actions github-actions bot added python PRs that change python files invocations PRs that change invocations backend PRs that change backend files frontend PRs that change frontend files labels Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend PRs that change backend files frontend PRs that change frontend files invocations PRs that change invocations python PRs that change python files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant