Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-deterministic Results #9

Closed
catboxanon opened this issue Oct 9, 2024 · 3 comments
Closed

Non-deterministic Results #9

catboxanon opened this issue Oct 9, 2024 · 3 comments

Comments

@catboxanon
Copy link

catboxanon commented Oct 9, 2024

Title. Images using the same seed produce different images each run (requires clearing the execution cache).

Workflow

{
  "last_node_id": 18,
  "last_link_id": 21,
  "nodes": [
    {
      "id": 11,
      "type": "DynSamplerSelect",
      "pos": {
        "0": -669,
        "1": 810
      },
      "size": {
        "0": 315,
        "1": 130
      },
      "flags": {},
      "order": 0,
      "mode": 0,
      "inputs": [],
      "outputs": [
        {
          "name": "SAMPLER",
          "type": "SAMPLER",
          "links": [
            15
          ],
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "DynSamplerSelect"
      },
      "widgets_values": [
        "euler_dy",
        1,
        2,
        false
      ]
    },
    {
      "id": 17,
      "type": "BasicScheduler",
      "pos": {
        "0": -671,
        "1": 1053
      },
      "size": {
        "0": 315,
        "1": 106
      },
      "flags": {},
      "order": 3,
      "mode": 0,
      "inputs": [
        {
          "name": "model",
          "type": "MODEL",
          "link": 21
        }
      ],
      "outputs": [
        {
          "name": "SIGMAS",
          "type": "SIGMAS",
          "links": [
            16
          ]
        }
      ],
      "properties": {
        "Node name for S&R": "BasicScheduler"
      },
      "widgets_values": [
        "normal",
        30,
        1
      ]
    },
    {
      "id": 10,
      "type": "CLIPTextEncode",
      "pos": {
        "0": -1296,
        "1": 1524
      },
      "size": {
        "0": 400,
        "1": 200
      },
      "flags": {},
      "order": 5,
      "mode": 0,
      "inputs": [
        {
          "name": "clip",
          "type": "CLIP",
          "link": 13
        }
      ],
      "outputs": [
        {
          "name": "CONDITIONING",
          "type": "CONDITIONING",
          "links": [
            17
          ],
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "CLIPTextEncode"
      },
      "widgets_values": [
        "1girl, solo, hakurei reimu, standing, cowboy shot, white background"
      ]
    },
    {
      "id": 4,
      "type": "CLIPTextEncode",
      "pos": {
        "0": -1296,
        "1": 1770
      },
      "size": {
        "0": 369.66241455078125,
        "1": 215.41033935546875
      },
      "flags": {},
      "order": 4,
      "mode": 0,
      "inputs": [
        {
          "name": "clip",
          "type": "CLIP",
          "link": 11
        }
      ],
      "outputs": [
        {
          "name": "CONDITIONING",
          "type": "CONDITIONING",
          "links": [
            18
          ],
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "CLIPTextEncode"
      },
      "widgets_values": [
        "worst quality, low quality, jpeg artifacts, bad anatomy, bad hands, multiple views, 4koma, watermark"
      ]
    },
    {
      "id": 6,
      "type": "EmptyLatentImage",
      "pos": {
        "0": -784,
        "1": 1668
      },
      "size": {
        "0": 315,
        "1": 106
      },
      "flags": {},
      "order": 1,
      "mode": 0,
      "inputs": [],
      "outputs": [
        {
          "name": "LATENT",
          "type": "LATENT",
          "links": [
            20
          ],
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "EmptyLatentImage"
      },
      "widgets_values": [
        832,
        1216,
        1
      ]
    },
    {
      "id": 1,
      "type": "CheckpointLoaderSimple",
      "pos": {
        "0": -2006,
        "1": 1267
      },
      "size": {
        "0": 449.052001953125,
        "1": 99.80590057373047
      },
      "flags": {},
      "order": 2,
      "mode": 0,
      "inputs": [],
      "outputs": [
        {
          "name": "MODEL",
          "type": "MODEL",
          "links": [
            14,
            21
          ],
          "slot_index": 0
        },
        {
          "name": "CLIP",
          "type": "CLIP",
          "links": [
            11,
            13
          ],
          "slot_index": 1
        },
        {
          "name": "VAE",
          "type": "VAE",
          "links": [
            7
          ],
          "slot_index": 2
        }
      ],
      "properties": {
        "Node name for S&R": "CheckpointLoaderSimple"
      },
      "widgets_values": [
        "Checkpoints\\illustriousXL_v10SPO.safetensors"
      ]
    },
    {
      "id": 8,
      "type": "VAEDecode",
      "pos": {
        "0": 153,
        "1": 1138
      },
      "size": {
        "0": 210,
        "1": 46
      },
      "flags": {},
      "order": 7,
      "mode": 0,
      "inputs": [
        {
          "name": "samples",
          "type": "LATENT",
          "link": 19
        },
        {
          "name": "vae",
          "type": "VAE",
          "link": 7
        }
      ],
      "outputs": [
        {
          "name": "IMAGE",
          "type": "IMAGE",
          "links": [
            8
          ],
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "VAEDecode"
      },
      "widgets_values": []
    },
    {
      "id": 7,
      "type": "PreviewImage",
      "pos": {
        "0": 428,
        "1": 1232
      },
      "size": {
        "0": 861.7905883789062,
        "1": 1227.2149658203125
      },
      "flags": {},
      "order": 8,
      "mode": 0,
      "inputs": [
        {
          "name": "images",
          "type": "IMAGE",
          "link": 8
        }
      ],
      "outputs": [],
      "properties": {
        "Node name for S&R": "PreviewImage"
      },
      "widgets_values": []
    },
    {
      "id": 15,
      "type": "SamplerCustom",
      "pos": {
        "0": -240,
        "1": 944
      },
      "size": [
        355.20001220703125,
        442
      ],
      "flags": {},
      "order": 6,
      "mode": 0,
      "inputs": [
        {
          "name": "model",
          "type": "MODEL",
          "link": 14
        },
        {
          "name": "positive",
          "type": "CONDITIONING",
          "link": 17
        },
        {
          "name": "negative",
          "type": "CONDITIONING",
          "link": 18
        },
        {
          "name": "sampler",
          "type": "SAMPLER",
          "link": 15
        },
        {
          "name": "sigmas",
          "type": "SIGMAS",
          "link": 16
        },
        {
          "name": "latent_image",
          "type": "LATENT",
          "link": 20
        }
      ],
      "outputs": [
        {
          "name": "output",
          "type": "LATENT",
          "links": [
            19
          ],
          "slot_index": 0
        },
        {
          "name": "denoised_output",
          "type": "LATENT",
          "links": null
        }
      ],
      "properties": {
        "Node name for S&R": "SamplerCustom"
      },
      "widgets_values": [
        true,
        1,
        "fixed",
        5
      ]
    }
  ],
  "links": [
    [
      7,
      1,
      2,
      8,
      1,
      "VAE"
    ],
    [
      8,
      8,
      0,
      7,
      0,
      "IMAGE"
    ],
    [
      11,
      1,
      1,
      4,
      0,
      "CLIP"
    ],
    [
      13,
      1,
      1,
      10,
      0,
      "CLIP"
    ],
    [
      14,
      1,
      0,
      15,
      0,
      "MODEL"
    ],
    [
      15,
      11,
      0,
      15,
      3,
      "SAMPLER"
    ],
    [
      16,
      17,
      0,
      15,
      4,
      "SIGMAS"
    ],
    [
      17,
      10,
      0,
      15,
      1,
      "CONDITIONING"
    ],
    [
      18,
      4,
      0,
      15,
      2,
      "CONDITIONING"
    ],
    [
      19,
      15,
      0,
      8,
      0,
      "LATENT"
    ],
    [
      20,
      6,
      0,
      15,
      5,
      "LATENT"
    ],
    [
      21,
      1,
      0,
      17,
      0,
      "MODEL"
    ]
  ],
  "groups": [],
  "config": {},
  "extra": {
    "ds": {
      "scale": 0.5408789293239545,
      "offset": [
        2392.1001949714805,
        -367.80144653396894
      ]
    }
  },
  "version": 0.4
}

@catboxanon catboxanon reopened this Oct 9, 2024
@pamparamm
Copy link
Owner

I ran your workflow on a pure ComfyUI installation (using Windows / torch 2.6.0.dev20240927+cu124 / SDP attention) with just ppm nodes enabled and it produced the same images.
{226C9774-5679-4C0D-955A-98CA2F376824}
ComfyUI_temp_xxbif_00001_

There is a known problem with determinism on ComfyUI (see comfyanonymous/ComfyUI#4518 or comfyanonymous/ComfyUI#2841), but you have add_noise enabled, so it shouldn't be the case.

  • Does this problem occur on a latest ComfyUI with only ComfyUI-ppm enabled?
  • On what OS / torch version / attention optimizer (SDP, xformers, etc.) does this problem occur?
  • Can you list your startup args for ComfyUI just in case?

@pamparamm
Copy link
Owner

pamparamm commented Oct 10, 2024

Oh, just noticed that I used a regular illustrious instead of SPO, so my image can be a little bit different from yours, but different weights of the same architecture obviously shouldn't cause issues with randomness

@catboxanon
Copy link
Author

catboxanon commented Oct 10, 2024

* Does this problem occur on a latest ComfyUI with only `ComfyUI-ppm` enabled?

Just tried with only ComfyUI-ppm enabled -- that resolved it, thank you. I'll close this for now but will post an update as soon as I determine the problematic custom node(s) enabled and then file a relevant issue upstream. Sorry for the noise.

Edit: Determined ComfyUI_smZNodes is causing the issue. Will look into it further and report upstream there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants