style_aligned_comfy

style_aligned_comfy
★ 308

风格一致化批量处理参考图像驱动ComfyUI节点
实现 a/StyleAligned 论文的方法,为批处理图像套用统一风格;默认以批内第一张图为风格参考,确保输出风格一致。
💡 将一张参考图的风格应用到同一批次的所有图像
🍴 17 Forks💻 Python🔄 2025-03-24
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/e00a65475347
📄 README

[!WARNING]

This repo is no longer actively maintained; please look for other forks or projects for similar functionality. If you’ve downloaded and used it in the past, thank you!

StyleAligned for ComfyUI

Implementation of the StyleAligned technique for ComfyUI.

This implementation is split into two different nodes, and does not require any additional models or dependencies.

StyleAligned Reference Sampler

This node replaces the KSampler, and lets you reference an existing latent as a style reference. In order to retrieve the latent, you will need to perform DDIM inversion; an example workflow for this is provided here.

_Above, a reference image, and a batch of images generated using the prompt ‘a robot’ and the reference image shown as style input._

Parameters

  • model: The base model to patch.
  • share_attn: Which components of self-attention are normalized. Defaults to q+k. Set to q+k+v for more extreme sharing, at the cost of quality in some cases.
  • share_norm: Whether to share normalization across the batch. Defaults to both. Set to group or layer to only share group or layer normalization, respectively.
  • scale: The scale at which to apply the style-alignment effect. Defaults to 1.
  • StyleAligned Batch Align

    Instead of referencing a single latent, this node aligns the style of the entire batch with the first image generated in the batch, effectively causing all images in the batch to be generated with the same style.

    _A batch of generations with the same parameters and the Batch Align node applied (left) and disabled (right)._

    Parameters

  • model: The base model to patch.
  • share_attn: Which components of self-attention are normalized. Defaults to q+k. Set to q+k+v for more extreme sharing, at the cost of quality in some cases.
  • share_norm: Whether to share normalization across the batch. Defaults to both. Set to group or layer to only share group or layer normalization, respectively.
  • scale: The scale at which to apply the style-alignment effect. Defaults to 1.
  • batch_size, noise_seed, control_after_generate, cfg: Identical to the standard KSampler parameters.
  • Installation

    Simply download or git clone this repository in ComfyUI/custom_nodes/. Example workflows are included in resources/.