Skip to content

ACE++ and UNO integration #7931

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

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

Conversation

attashe
Copy link

@attashe attashe commented Apr 17, 2025

Summary

Type of change: Feature

Redux is very powerful instrument for Flux generattion but have sometimes it's hard to find a balance with precision/flexibility/prompt cohere. Novel methods can outperform Redux on some tasks.

https://ali-vilab.github.io/ACE_plus_page/
https://bytedance.github.io/UNO/

What's Done:

  1. ACE++ Integration:

    • Added image concatenation nodes (for left/right/top/bottom stitching; requires images of the same size).
    • Implemented generation using a Reference Image and Mask Editing.
    • Maintained backward compatibility with existing pipelines.

    ACE++ node:
    изображение

Output width/height/pad settings are used to crop the result from the concatenated image.
изображение

Image Concatenation node:
изображение

Generation with reference example + Redux:
ace_redux_generation_2

Mask editing with reference:
ace_inpaint_2

  1. UNO Implementation:
    • Added support for up to 4 reference images via latent space concatenation.
    • Implemented Universal Positional Embeddings (UnoPE) using Rotary Position Embedding adaptation.
    • Added a new input port to the "FLUX denoise" node for reference sources.

UNO reference images loading node:

изображение

Results:
uno_1_reference
uno_reference

Only first image slot is require others are optional

Discussions

ACE++: Shows good compatibility. Additional inpainting nodes could be beneficial, for example, for crop-mask inpainting at higher resolutions. A good example is this ComfyUI node collection:
https://github.com/lquesada/ComfyUI-Inpaint-CropAndStitch

UNO: Compatibility is limited, and it can be slightly unstable at higher resolutions (> 512-768). Generation with UNO requires a special LoRA. In the original repository, it is saved in the Xlabs-lora format, which is not compatible with other frameworks. I converted it to the diffusers LoRA format.

  • ACE++: Processing takes 1.5-1.7 times longer because the input image tensor expands 1.5-2 times.
  • UNO: Processing time increases by 50%-100%, depending on the input size and the number of reference images.

Merge Plan

Patch adds new nodes that doesn't interact with others. UNO encoding add some code into backend but they have no effects if no referece image was provided

Checklist

  • ACE++ integration
  • UNO integration
  • New nodes

Workflows:

UNOExperimentsWorkflow.json
InpaintEditingACEpp.json
ReduxGenerationACEpp.json

@github-actions github-actions bot added python PRs that change python files invocations PRs that change invocations backend PRs that change backend files labels Apr 17, 2025
@hipsterusername
Copy link
Member

@attashe - I'm just now getting a chance to test both of these. ACE++ is working well, but I'm unable to get Uno to work. Can you share some examples of how the workflow should be configured to produce meaningful results?

@psychedelicious
Copy link
Collaborator

ACE++ is working well for me - pretty cool! Uno does something but I'm having a hard time getting it to do something useful... That said, I've only done some quick testing.

I did some minor cleanup:

  • Format with ruff (make ruff from repo root)
  • Update the Uno node and field to accept a list of images

@psychedelicious
Copy link
Collaborator

Note: It's not necessary to provide latents to the denoise node, unless we are doing partial denoising (i.e. denoise_start > 0).

@attashe
Copy link
Author

attashe commented Apr 23, 2025

@hipsterusername
This is workflow that works for me. Important to load uno_lora_diffusers.safetensors not converted
With multiple references it works better with smaller resolution - 768, 512.
test_uno.json

изображение
изображение

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 invocations PRs that change invocations python PRs that change python files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants