Nodes Browser

ComfyDeploy: How Gridswapper works in ComfyUI?

What is Gridswapper?

Gridswapper takes a batch of latents and spreads them over the necessary amount of grids. It then automatically shuffles the images in the grids for each step. So, a batch of 12 latents for a 2x2 grid will generate 3 grid images in each step. It will then shuffle around the images for the next step. This makes it possible for all images to influence the others during the denoising process. This approach works well for generating 2-4 grids.

How to install it in ComfyDeploy?

Head over to the machine page

  1. Click on the "Create a new machine" button
  2. Select the Edit build steps
  3. Add a new step -> Custom Node
  4. Search for Gridswapper and select it
  5. Close the build step dialig and then click on the "Save" button to rebuild the machine

Gridswapper

Gridswapper takes a batch of latents and spreads them over the necessary amount of grids. It then automatically shuffles the images in the grids for each step. So, a batch of 12 latents for a 2x2 grid will generate 3 grid images in each step. It will then shuffle around the images for the next step. This makes it possible for all images to influence the others during the denoising process. This approach works well for generating 2-4 grids.

To improve convergence, especially when generating many grids, consider:

  • Increasing the number of steps, (for example 4*batch size) - this makes it more likely that each image can influence all others during the shuffling process
  • Using ancestral samplers (like euler_a) - the added noise at each step seems to help with consistency
  • Train a lora on 2x2 grids of the type of pictures you want to generate.

<img width="1001" alt="Screenshot 2024-10-26 at 20 57 21" src="https://github.com/user-attachments/assets/901e9a62-0c06-420b-afa5-6701a784e858">