{"id":23233410,"url":"https://github.com/shiimizu/ComfyUI-TiledDiffusion","last_synced_at":"2025-08-19T18:32:08.126Z","repository":{"id":215927461,"uuid":"740043450","full_name":"shiimizu/ComfyUI-TiledDiffusion","owner":"shiimizu","description":"Tiled Diffusion, MultiDiffusion, Mixture of Diffusers, and optimized VAE","archived":false,"fork":false,"pushed_at":"2024-12-01T21:53:41.000Z","size":103,"stargazers_count":331,"open_issues_count":27,"forks_count":23,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-12-01T22:32:36.764Z","etag":null,"topics":["comfyui","image-generation","large-image","multidiffusion","stable-diffusion","vramsaving"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shiimizu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-07T10:57:58.000Z","updated_at":"2024-12-01T21:53:44.000Z","dependencies_parsed_at":"2024-11-08T07:25:47.779Z","dependency_job_id":null,"html_url":"https://github.com/shiimizu/ComfyUI-TiledDiffusion","commit_stats":null,"previous_names":["shiimizu/comfyui-tileddiffusion"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiimizu%2FComfyUI-TiledDiffusion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiimizu%2FComfyUI-TiledDiffusion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiimizu%2FComfyUI-TiledDiffusion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiimizu%2FComfyUI-TiledDiffusion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shiimizu","download_url":"https://codeload.github.com/shiimizu/ComfyUI-TiledDiffusion/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230367780,"owners_count":18215325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comfyui","image-generation","large-image","multidiffusion","stable-diffusion","vramsaving"],"created_at":"2024-12-19T03:01:36.614Z","updated_at":"2024-12-19T03:01:49.219Z","avatar_url":"https://github.com/shiimizu.png","language":"Python","funding_links":[],"categories":["Workflows (3395) sorted by GitHub Stars","All Workflows Sorted by GitHub Stars"],"sub_categories":[],"readme":"# Tiled Diffusion \u0026 VAE for ComfyUI\r\n\r\nCheck out the [SD-WebUI extension](https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111/) for more information.\r\n\r\nThis extension enables **large image drawing \u0026 upscaling with limited VRAM** via the following techniques:\r\n\r\n- Reproduced SOTA Tiled Diffusion methods\r\n    - [MultiDiffusion](https://github.com/omerbt/MultiDiffusion) \u003ca href=\"https://arxiv.org/abs/2302.08113\"\u003e\u003cimg width=\"32\" alt=\"MultiDiffusion Paper\" src=\"https://github.com/shiimizu/ComfyUI-TiledDiffusion/assets/54494639/b753b7f6-f9c0-405d-bace-792b9bbce5d5\"\u003e\u003c/a\u003e\r\n    - [Mixture of Diffusers](https://github.com/albarji/mixture-of-diffusers) \u003ca href=\"https://arxiv.org/abs/2302.02412\"\u003e\u003cimg width=\"32\" alt=\"Mixture of Diffusers Paper\" src=\"https://github.com/shiimizu/ComfyUI-TiledDiffusion/assets/54494639/b753b7f6-f9c0-405d-bace-792b9bbce5d5\"\u003e\u003c/a\u003e\r\n- pkuliyi2015 \u0026 Kahsolt's Tiled VAE algorithm\r\n- ~~pkuliyi2015 \u0026 Kahsolt's TIled Noise Inversion method~~\r\n\r\n\u003e [!NOTE]  \r\n\u003e Sizes/dimensions are in pixels and then converted to latent-space sizes.\r\n\r\n\r\n## Features\r\n\r\n- [x] Supported models\r\n    - [x] SD1.x, SD2.x, SDXL, SD3\r\n    - [x] FLUX\r\n- [x] ControlNet support\r\n- [ ] ~~StableSR support~~\r\n- [ ] ~~Tiled Noise Inversion~~\r\n- [x] Tiled VAE\r\n- [ ] Regional Prompt Control\r\n- [x] Img2img upscale\r\n- [x] Ultra-Large image generation\r\n\r\n## Tiled Diffusion\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n  \u003cimg width=\"500\" alt=\"Tiled_Diffusion\" src=\"https://github.com/shiimizu/ComfyUI-TiledDiffusion/assets/54494639/7cb897a3-a645-426f-8742-d6ba5cf04b64\"\u003e\r\n\u003c/div\u003e\r\n\r\n\u003e [!TIP]  \r\n\u003e * Set `tile_overlap` to 0 and `denoise` to 1 to see the tile seams and then adjust the options to your needs.\r\n\u003e * Increase `tile_batch_size` to increase speed (if your machine can handle it).\r\n\u003e * Use the [colorfix node](https://github.com/gameltb/Comfyui-StableSR) if your colors look off.\r\n\r\n### Options\r\n\r\n| Name              | Description                                                  |\r\n|-------------------|--------------------------------------------------------------|\r\n| `method`          | Tiling [strategy](https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111/blob/fbb24736c9bc374c7f098f82b575fcd14a73936a/scripts/tilediffusion.py#L39-L46).  |\r\n| `tile_width`      | Tile's width                                                 |\r\n| `tile_height`     | Tile's height                                                |\r\n| `tile_overlap`    | Tile's overlap                                               |\r\n| `tile_batch_size` | The number of tiles to process in a batch                    |\r\n\r\n### How can I specify the tiles' arrangement?\r\n\r\nIf you have the [Math Expression](https://github.com/pythongosssss/ComfyUI-Custom-Scripts#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.\r\n\r\n`C` = number of columns you want  \r\n`R` = number of rows you want\r\n\r\n`pixel width of input image or latent // C` = `tile_width`  \r\n`pixel height of input image or latent // R` = `tile_height`\r\n\r\n\u003cimg width=\"800\" alt=\"Tile_arrangement\" src=\"https://github.com/shiimizu/ComfyUI-TiledDiffusion/assets/54494639/9952e7d8-909e-436f-a284-c00f0fb71665\"\u003e\r\n\r\n### SpotDiffusion\r\n\r\n[Paper](https://arxiv.org/abs/2407.15507)\r\n\r\nA tiling algorithm that attempts to eliminate seams by randomly shifting the denoise window per timestep. It is mainly used for fast inferences by setting `tile_overlap` to 0; otherwise, it's better to stick with the other tiling strategies as they produce better outputs.\r\n\r\nThis additional feature is experimental, in testing,  and subject to change.\r\n\r\n## Tiled VAE\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n  \u003cimg width=\"900\" alt=\"Tiled_VAE\" src=\"https://github.com/shiimizu/ComfyUI-TiledDiffusion/assets/54494639/b5850e03-2cac-49ce-b1fe-a67906bf4c9d\"\u003e\r\n\u003c/div\u003e\r\n\r\n\u003cbr\u003e\r\n\r\nThe recommended tile sizes are given upon the creation of the node based on the available VRAM.   \r\n\r\n\u003e [!NOTE]  \r\n\u003e Enabling `fast` for the decoder may produce images with slightly higher contrast and brightness.\r\n\r\n### Options\r\n\r\n| Name        | Description                                                                                                                                  |\r\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------|\r\n| `tile_size` |  \u003cblockquote\u003eThe image is split into tiles, which are then padded with 11/32 pixels' in the decoder/encoder.\u003c/blockquote\u003e                                 |\r\n| `fast`      |  \u003cblockquote\u003e\u003cp\u003eWhen Fast Mode is disabled:\u003c/p\u003e \u003col\u003e \u003cli\u003eThe original VAE forward is decomposed into a task queue and a task worker, which starts to process each tile.\u003c/li\u003e \u003cli\u003eWhen GroupNorm is needed, it suspends, stores current GroupNorm mean and var, send everything to RAM, and turns to the next tile.\u003c/li\u003e \u003cli\u003eAfter all GroupNorm means and vars are summarized, it applies group norm to tiles and continues. \u003c/li\u003e \u003cli\u003eA zigzag execution order is used to reduce unnecessary data transfer.\u003c/li\u003e \u003c/ol\u003e \u003cp\u003eWhen Fast Mode is enabled:\u003c/p\u003e \u003col\u003e \u003cli\u003eThe original input is downsampled and passed to a separate task queue.\u003c/li\u003e \u003cli\u003eIts group norm parameters are recorded and used by all tiles\u0026#39; task queues.\u003c/li\u003e \u003cli\u003eEach tile is separately processed without any RAM-VRAM data transfer.\u003c/li\u003e \u003c/ol\u003e \u003cp\u003eAfter all tiles are processed, tiles are written to a result buffer and returned.\u003c/p\u003e\u003c/blockquote\u003e |\r\n| `color_fix` | \u003cblockquote\u003eOnly estimate GroupNorm before downsampling, i.e., run in a semi-fast mode.\u003c/blockquote\u003e\u003cp\u003eOnly for the encoder. Can restore colors if tiles are too small.\u003c/p\u003e  |\r\n\r\n\r\n\r\n## Workflows\r\n\r\nThe following images can be loaded in ComfyUI.\r\n\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n  \u003cimg alt=\"ComfyUI_07501_\" src=\"https://github.com/shiimizu/ComfyUI-TiledDiffusion/assets/54494639/c3713cfb-e083-4df4-a310-9467827ee666\"\u003e\r\n  \u003cp\u003eSimple upscale.\u003c/p\u003e\r\n\u003c/div\u003e\r\n\r\n\u003cbr\u003e\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n\r\n  \u003cimg alt=\"ComfyUI_07503_\" src=\"https://github.com/shiimizu/ComfyUI-TiledDiffusion/assets/54494639/b681b617-4bb1-49e5-b85a-ef5a0f6e4830\"\u003e\r\n  \u003cp\u003e4x upscale. 3 passes.\u003c/p\u003e\r\n\u003c/div\u003e\r\n\r\n## License\r\nGreat thanks to all the contributors! 🎉🎉🎉   \r\nThe implementation of MultiDiffusion, Mixture of Diffusers, and Tiled VAE code is currently under [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-nc-sa/4.0/) since it was borrowed from the wonderful [SD-WebUI extension](https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111/). Anything else GPLv3.\r\n\r\n## Citation\r\n\r\n```bibtex\r\n@article{jimenez2023mixtureofdiffusers,\r\n  title={Mixture of Diffusers for scene composition and high resolution image generation},\r\n  author={Álvaro Barbero Jiménez},\r\n  journal={arXiv preprint arXiv:2302.02412},\r\n  year={2023}\r\n}\r\n```\r\n\r\n```bibtex\r\n@article{bar2023multidiffusion,\r\n  title={MultiDiffusion: Fusing Diffusion Paths for Controlled Image Generation},\r\n  author={Bar-Tal, Omer and Yariv, Lior and Lipman, Yaron and Dekel, Tali},\r\n  journal={arXiv preprint arXiv:2302.08113},\r\n  year={2023}\r\n}\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiimizu%2FComfyUI-TiledDiffusion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiimizu%2FComfyUI-TiledDiffusion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiimizu%2FComfyUI-TiledDiffusion/lists"}