Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TencentQQGYLab/ComfyUI-ELLA

Repository files navigation

ComfyUI-ELLA


ComfyUI implementation for ELLA.

🌟 Changelog

  • [2024εΉ΄4月30ζ—₯] Add a new node ELLA Text Encode to automatically concat ella and clip condition.
  • [2024εΉ΄4月24ζ—₯] Upgraded ELLA Apply method. Better compatibility with the comfyui ecosystem. Refer to the method mentioned in ComfyUI_ELLA PR #25
    • DEPRECATED: Apply ELLA without simgas is deprecated and it will be removed in a future version.
  • [2024εΉ΄4月22ζ—₯] Fix unstable quality of image while multi-batch. Add CLIP concat (support lora trigger words now).
  • [2024εΉ΄4月19ζ—₯] Documenting nodes.
  • [2024εΉ΄4月19ζ—₯] Initial repo.

πŸ“Œ Notice

  • SIGMAS from node BasicScheduler or TIMESTEPS by node Set ELLA Timesteps must be the same as the KSampler settings. Because Timestep-Aware Semantic Connector (TSC), which dynamically adapts semantics features over sampling time steps, has been introduced.
  • If you need concat clip CONDITIONING to make LoRA trigger words effective, ELLA output CONDITIONING always needs to be linked to the conditioning_to of Conditioning (Concat) node.

πŸ“š Example workflows

The examples directory has workflow examples. You can directly load these images as workflow into ComfyUI for use.

workflow_example

All legacy workflows was compatible. But it is deprecated and will be removed in a future version.

workflow_example_legacy

πŸŽ‰ It works with controlnet!

workflow_controlnet

πŸŽ‰ It works with lora trigger words by concat CLIP CONDITIONING!

⚠️ NOTE again that ELLA CONDITIONING always needs to be linked to the conditioning_to of Conditioning (Concat) node.

workflow_lora

With ELLA Text Encode node, can simplify the workflow.

With the upgrade(2024εΉ΄4月24ζ—₯), some interesting workflow can be implemented, such as using ELLA only in positive. As shown below:

workflow_lora_positive_ella_only

positive + negative positive only
ella_with_lora ella_with_lora_positive_only

However, there is no guarantee that positive-only will bring better results.

Workflow with AYS.

workflow_ella_ays

AYS got with more visual details and better text-alignment, ref to paper.

w/ AYS w/o AYS

And EMMA is working in progress.

πŸ“— Install

Download or git clone this repository inside ComfyUI/custom_nodes/ directory. ComfyUI-ELLA requires the latest version of ComfyUI. If something doesn't work be sure to upgrade.

cd ComfyUI/custom_nodes
git clone https://github.com/TencentQQGYLab/ComfyUI-ELLA

Next install dependencies.

cd ComfyUI-ELLA
pip install -r requirements.txt

πŸ“™ Models

These models must be placed in the corresponding directories under models.

Remember you can also use any custom location setting an ella & ella_encoder entry in the extra_model_paths.yaml file.

  • ComfyUI/models/ella, create it if not present.
  • ComfyUI/models/ella_encoder, create it if not present.

In summary, you should have the following model directory structure:

ComfyUI/models/ella/
└── ella-sd1.5-tsc-t5xl.safetensors
ComfyUI/models/ella_encoder/
└── models--google--flan-t5-xl--text_encoder
 β”œβ”€β”€ config.json
 β”œβ”€β”€ model.safetensors
 β”œβ”€β”€ special_tokens_map.json
 β”œβ”€β”€ spiece.model
 β”œβ”€β”€ tokenizer_config.json
 └── tokenizer.json

πŸ“– Nodes reference

Nodes reference

πŸ” Common promblem

  • XXX not implemented for 'Half'. See issue #12
  • AYS + Ella getting dark image generations. See issue #39
    • Check if add_noise of SamplerCustom node is enabled.
    • Lower the cfg of SamplerCustom node.

πŸ“ TODO

  • Support prompt weighting

πŸ€— Contributors (direct & indirect)

πŸ˜‹ Thanks

πŸ˜‰ Citation

@misc{hu2024ella,
 title={ELLA: Equip Diffusion Models with LLM for Enhanced Semantic Alignment}, 
 author={Xiwei Hu and Rui Wang and Yixiao Fang and Bin Fu and Pei Cheng and Gang Yu},
 year={2024},
 eprint={2403.05135},
 archivePrefix={arXiv},
 primaryClass={cs.CV}
}

About

ELLA nodes for ComfyUI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /