Skip to content

Deathspike/ComfyUI-TiledAttentionCouple

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Changelog

  • 1.3 - Added optional tile shuffling.
  • 1.2 - Added integration for Impact Pack detailers.
  • 1.1 - Improved return names and error feedback.
  • 1.0 - Initial release.

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.

For Impact Pack integration with FaceDetailer, follow these additional steps:

  1. Add Tiled Attention Couple (Impact Pack Detailer).
  2. Connect Tiled Attention Couple (Impact Pack Detailer) to FaceDetailer detailer_hook.
  3. Connect Tiled Attention Couple (Prompt) to Tiled Attention Couple (Impact Pack Detailer).
  4. Connect Tiled Attention Couple (Impact Pack Detailer) with an input model and clip.

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 → right tile is twice as large as the left tile.
  • 1,2 vertical → bottom tile is twice as large as the top 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.

2girls

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

3girls

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

3girls with FaceDetailer

2girls,
maid, cafe,
masterpiece, best quality,
BREAK
takamachi nanoha, short twintails, 
light smile,
BREAK
fate testarossa, straight hair, 
nose blush, 

The common prompt 2girls, maid, cafe, 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, light smile, while the right tile receives fate testarossa, straight hair, nose blush. Faces are then improved with FaceDetailer:

2girls, maid, cafe, masterpiece, best quality, BREAK takamachi nanoha, short twintails, light smile, BREAK fate testarossa, straight hair, nose blush

3girls (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

Packages

 
 
 

Contributors

Languages

  • Python 100.0%