Can Stable Diffusion web UI and ComfyUI generate the same image?

Short answer: getting exactly the same image is almost impossible.

The two biggest reasons are:

  • They generate noise differently
  • They calculate prompt weights differently

1. They generate noise differently

Diffusion models create images out of noise. So if the noise pattern is different, the generated image will naturally be different too.

Noise generation is very sensitive. Even just a difference in where the noise is generated turns the same seed into a different pattern.

  • ComfyUI

    • Generates noise on the CPU
    • Designed so that "same seed, same noise" tends to hold even across different GPUs and environments
  • Stable Diffusion web UI

    • Generates noise on the GPU

Because of this, the initial noise pattern is completely different even with the same seed. And if the initial noise differs, the final images won't match, no matter how the diffusion process plays out.


2. They calculate prompt weights differently

The two also handle weights written with parentheses and colons differently.

  • ComfyUI

    • If you write (masterpiece:1.2), it uses exactly 1.2
    • Even with multiple weighted words, it basically does not normalize them
  • Stable Diffusion web UI

    • Normalizes (evens out) the weights together
    • Raising the weight of one word lowers the weights of all the other words evenly

The official FAQ gives this example:

Input prompt

(masterpiece:1.2) (best:1.3) (quality:1.4) girl

Stable Diffusion web UI normalizes it

(masterpiece:0.98) (best:1.06) (quality:1.14) (girl:0.81)

ComfyUI does not normalize it

masterpiece = 1.2 / best = 1.3 / quality = 1.4 / girl = 1.0 stay as they are

So even if you type the same text and the same numbers, the actual weights passed to the text encoder are different, and you don't get the same picture.


So how do you get exactly the same image?

There are custom nodes and other approaches that mimic Stable Diffusion web UI's weighting logic, but differences such as noise generation remain, so aiming for an exact match is quite difficult.

Personally, I think it's better to accept that they are two different tools built on different design philosophies.