Skip to content

ComfyNodePRs/PR-ComfyUI-TiledAttentionCouple-2bafc33d

 
 

Repository files navigation

TiledAttentionCouple

TiledAttentionCouple is a custom node for ComfyUI that enables Attention Coupling across horizontal or vertical tiles. It allows fine(r)-grained control of prompts across different sections of the image. This is especially useful in scenarios where multiple subjects or themes need to coexist in an image without blending them.

3girls, side-by-side, upper body, blue sky, masterpiece, best quality, BREAK fate testarossa, straight hair, blue dress, nose blush, averting eyes, BREAK takamachi nanoha, short twintails, red dress, closed eyes, BREAK yagami hayate, white dress, naughty face, smug

Installation

Navigate to your ComfyUI custom_nodes directory:

cd /path/to/comfyui/custom_nodes

Clone the repository:

git clone https://github.com/Deathspike/ComfyUI-TiledAttentionCouple

Restart ComfyUI to load the new nodes.

Configuration

Follow these steps to integrate Tiled Attention Couple into your workflow:

  1. Replace positive and negative prompt with Tiled Attention Couple (Prompt).
  2. Add Tiled Attention Couple. Match width and height properties to output.
  3. Connect Tiled Attention Couple (Prompt) to Tiled Attention Couple.
  4. Connect Tiled Attention Couple with an input model and clip.
  5. Use Tiled Attention Couple output model and conditionings.

Usage

TiledAttentionCouple slices the image into horizontal or vertical tiles based on your chosen division and orientation. The division is a comma-seperated string representing each tile, where each number represents the relative size of that specific tile:

  • 1,1 → two equally-sized tiles.
  • 1,2 → two tiles, the second is twice as large as the first.
  • 1,1,1 → three equally-sized tiles.

The orientation determines how the tiles are divided: horizontal places tiles side by side (left to right), while vertical stacks them on top of each other (top to bottom):

  • 1,2 horizontal → bottom tile is twice as large as the top tile.
  • 1,2 vertical → right tile is twice as large as the left tile.

Prompts start with a common prompt that applies to the entire image. After this, you can add tile prompts by separating them with the keyword BREAK. Each BREAK corresponds to a tile in sequential order, from left to right (for horizontal) or top to bottom (for vertical).

Previews & Workflows

All previews come with ComfyUI workflows for reference and reproducibility. The showcased results were generated using my NanoMix v13 model.

Nanoha x Fate

2girls, side-by-side,
masterpiece, best quality,
BREAK
takamachi nanoha, short twintails, 
red dress,
BREAK
fate testarossa, straight hair, 
blue dress,

The common prompt 2girls, side-by-side, masterpiece, best quality is applied to the entire image. Using a division of 1,1 and horizontal orientation, the left tile receives the tile prompt takamachi nanoha, short twintails, red dress, while the right tile receives fate testarossa, straight hair, blue dress:

2girls, side-by-side, masterpiece, best quality, BREAK takamachi nanoha, short twintails, red dress, BREAK fate testarossa, straight hair, blue dress

Nanoha x Fate x Hayate

3girls, side-by-side,
masterpiece, best quality,
BREAK
takamachi nanoha, short twintails, 
red dress,
BREAK
fate testarossa, straight hair, 
blue dress,
BREAK
yagami hayate, 
white dress, 

The common prompt 3girls, side-by-side, masterpiece, best quality is applied to the entire image. Using a division of 1,1,1 and horizontal orientation, the left tile receives the tile prompt takamachi nanoha, short twintails, red dress, the middle tile receives fate testarossa, straight hair, blue dress, while the right tile receives yagami hayate, white dress:

3girls, side-by-side, masterpiece, best quality, BREAK takamachi nanoha, short twintails, red dress, BREAK fate testarossa, straight hair, blue dress, BREAK yagami hayate, white dress

Nanoha x Fate x Hayate (Banner)

3girls, side-by-side, upper body, 
blue sky, 
masterpiece, best quality,
BREAK
fate testarossa, straight hair, 
blue dress,
nose blush, averting eyes, 
BREAK
takamachi nanoha, short twintails, 
red dress,
closed eyes, 
BREAK
yagami hayate, 
white dress, 
naughty face, smug,

The common prompt 3girls, side-by-side, upper body, blue sky, masterpiece, best quality is applied to the entire image. Using a division of 1,0.75,1 and horizontal orientation, the left tile receives the tile prompt fate testarossa, straight hair, blue dress, nose blush, averting eyes, the middle tile receives takamachi nanoha, short twintails, red dress, closed eyes, while the right tile receives yagami hayate, white dress, naughty face, smug:

3girls, side-by-side, upper body, blue sky, masterpiece, best quality, BREAK fate testarossa, straight hair, blue dress, nose blush, averting eyes, BREAK takamachi nanoha, short twintails, red dress, closed eyes, BREAK yagami hayate, white dress, naughty face, smug

Community

If you enjoy TiledAttentionCouple, check out more of my work:

Got questions or want to show off something you made with TiledAttentionCouple?

  • 💬 Join our anime Discord. I’m @Deathspike, and I’d love to hear from you!

Credits

"Every tile begins with the foundation laid by others."

About

Custom node for attention coupling across horizontal or vertical tiles in ComfyUI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%