1 Star 0 Fork 0

欧阳宏宇/ComfyUI-TiledDiffusion

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Tiled Diffusion & VAE for ComfyUI

See this for more information.

This extension enables large image drawing & upscaling with limited VRAM via the following techniques:

  1. Two SOTA diffusion tiling algorithms: Mixture of Diffusers Mixture of Diffusers Paper and MultiDiffusion MultiDiffusion Paper
  2. pkuliyi2015 & Kahsolt's Tiled VAE algorithm.
  3. pkuliyi2015 & Kahsolt's TIled Noise Inversion for better upscaling.

[!NOTE]
Sizes/dimensions are in pixels and then converted to latent-space sizes.

Features

  • SDXL model support
  • ControlNet support
  • StableSR support
  • Tiled Noise Inversion
  • Tiled VAE
  • Regional Prompt Control
  • Img2img upscale
  • Ultra-Large image generation

Some conditioning nodes like SetArea or GLIGEN aren't working at the moment.

Tiled Diffusion

Tiled_Diffusion

[!TIP]
Set tile_overlap to 0 and denoise to 1 to see the tile seams and then adjust the options to your needs. Also, increase tile_batch_size to increase speed (if your machine can handle it).

Name Description
method Tiling strategy. MultiDiffusion or Mixture of Diffusers.
tile_width Tile's width
tile_height Tile's height
tile_overlap Tile's overlap
tile_batch_size The number of tiles to process in a batch

How can I specify the tiles' arrangement?

If you have the Math Expression node (or something similar), you can use that to pass in the latent that's passed in your KSampler and divide the tile_height/tile_width by the number of rows/columns you want.

C = number of columns you want
R = number of rows you want

pixel width of input image or latent // C = tile_width
pixel height of input image or latent // R = tile_height

Tile_arrangement

Tiled VAE

Tiled_VAE

The recommended tile sizes are given upon the creation of the node based on the available VRAM.

[!NOTE]
Enabling fast for the decoder may produce images with slightly higher contrast and brightness.

Name Description
tile_size
The image is split into tiles, which are then padded with 11/32 pixels' in the decoder/encoder.
fast

When Fast Mode is disabled:

  1. The original VAE forward is decomposed into a task queue and a task worker, which starts to process each tile.
  2. When GroupNorm is needed, it suspends, stores current GroupNorm mean and var, send everything to RAM, and turns to the next tile.
  3. After all GroupNorm means and vars are summarized, it applies group norm to tiles and continues.
  4. A zigzag execution order is used to reduce unnecessary data transfer.

When Fast Mode is enabled:

  1. The original input is downsampled and passed to a separate task queue.
  2. Its group norm parameters are recorded and used by all tiles' task queues.
  3. Each tile is separately processed without any RAM-VRAM data transfer.

After all tiles are processed, tiles are written to a result buffer and returned.

color_fix
Only estimate GroupNorm before downsampling, i.e., run in a semi-fast mode.

Only for the encoder. Can restore colors if tiles are too small.

Workflows

The following images can be loaded in ComfyUI.

ComfyUI_07501_

Simple upscale.


ComfyUI_07503_

4x upscale. 3 passes.

Citation

@article{jimenez2023mixtureofdiffusers,
  title={Mixture of Diffusers for scene composition and high resolution image generation},
  author={Álvaro Barbero Jiménez},
  journal={arXiv preprint arXiv:2302.02412},
  year={2023}
}
@article{bar2023multidiffusion,
  title={MultiDiffusion: Fusing Diffusion Paths for Controlled Image Generation},
  author={Bar-Tal, Omer and Yariv, Lior and Lipman, Yaron and Dekel, Tali},
  journal={arXiv preprint arXiv:2302.08113},
  year={2023}
}

空文件

简介

取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tkliuxing/ComfyUI-TiledDiffusion.git
git@gitee.com:tkliuxing/ComfyUI-TiledDiffusion.git
tkliuxing
ComfyUI-TiledDiffusion
ComfyUI-TiledDiffusion
main

搜索帮助