Skip to content

Severe performance degradation over consecutive runs after upgrading to V0.18 (ksampler slows from 1.79s/t to 35s/t) #13087

Description

@glolionline

Custom Node Testing

Expected Behavior

Performance should remain stable across consecutive runs without progressive slowdown.

Actual Behavior

After upgrading ComfyUI to V0.18, a previously stable workflow exhibits severe performance degradation. The ksampler step time (s/t) increases linearly with each consecutive generation, causing overall runtime to become progressively slower.
Total execution time increased from 30.71 seconds(The first run includes first loading time) to 168.86 seconds over consecutive runs(same input image).
Note that lowvram patches count accumulates over runs: 0 → 41 → 58 → 75 → 76 → 93 → 110 → 127
The log below is from a basic Flux Klein 9B distilled editing workflow. Previously, on V0.17, I used the --disable-dynamic-vram argument because a separate Qwen edit workflow with GGUF CLIP would throw errors without it. This Klein 9B workflow ran normally under that setup before. Workflow run time was around 12-15 seconds.

Steps to Reproduce

workflow is pretty simple, a flux klein 9b distilled edit workflow
add disable dynamic vram to comfy.settings.json:
"Comfy.Server.LaunchArgs": {
"preview-method": "latent2rgb",
"disable-dynamic-vram": ""
},
Image

Debug Logs

got prompt
Using pytorch attention in VAE
Using pytorch attention in VAE
VAE load device: cuda:0, offload device: cpu, dtype: torch.bfloat16
Requested to load AutoencoderKL
loaded completely; 6971.51 MB usable, 160.31 MB loaded, full load: True
Found quantization metadata version 1
Using MixedPrecisionOps for text encoder
CLIP/text encoder model load device: cuda:0, offload device: cpu, current: cpu, dtype: torch.float16
Requested to load Flux2TEModel_
loaded completely; 9441.49 MB usable, 8263.34 MB loaded, full load: True
Found quantization metadata version 1
Detected mixed precision quantization
Using mixed precision operations
model weight dtype torch.bfloat16, manual cast: torch.bfloat16
model_type FLUX
Requested to load Flux2
loaded partially; 7240.42 MB usable, 6864.00 MB loaded, 2132.02 MB offloaded, 624.00 MB buffer reserved, lowvram patches: 41
100%|██████████| 4/4 [00:07<00:00,  1.79s/it]
Requested to load AutoencoderKL
Unloaded partially: 976.00 MB freed, 5888.00 MB remains loaded, 624.00 MB buffer reserved, lowvram patches: 58
loaded completely; 200.41 MB usable, 160.31 MB loaded, full load: True
Prompt executed in 30.71 seconds
got prompt
loaded partially; 7269.41 MB usable, 6912.00 MB loaded, 2084.02 MB offloaded, 624.00 MB buffer reserved, lowvram patches: 0
100%|██████████| 4/4 [00:23<00:00,  5.91s/it]
Requested to load AutoencoderKL
Unloaded partially: 960.00 MB freed, 5952.00 MB remains loaded, 624.00 MB buffer reserved, lowvram patches: 75
loaded completely; 180.02 MB usable, 160.31 MB loaded, full load: True
Prompt executed in 34.69 seconds
got prompt
Unloaded partially: 64.00 MB freed, 5888.00 MB remains loaded, 624.00 MB buffer reserved, lowvram patches: 76
loaded partially; 7237.42 MB usable, 6864.00 MB loaded, 2132.02 MB offloaded, 624.00 MB buffer reserved, lowvram patches: 0
100%|██████████| 4/4 [00:19<00:00,  4.76s/it]
Requested to load AutoencoderKL
Unloaded partially: 976.00 MB freed, 5888.00 MB remains loaded, 624.00 MB buffer reserved, lowvram patches: 93
loaded completely; 200.41 MB usable, 160.31 MB loaded, full load: True
Prompt executed in 28.98 seconds
got prompt
loaded partially; 7237.42 MB usable, 6864.00 MB loaded, 2132.02 MB offloaded, 624.00 MB buffer reserved, lowvram patches: 0
100%|██████████| 4/4 [01:07<00:00, 16.95s/it]
Requested to load AutoencoderKL
Unloaded partially: 976.00 MB freed, 5888.00 MB remains loaded, 624.00 MB buffer reserved, lowvram patches: 110
loaded completely; 200.41 MB usable, 160.31 MB loaded, full load: True
Prompt executed in 81.61 seconds
got prompt
loaded partially; 7237.42 MB usable, 6864.00 MB loaded, 2132.02 MB offloaded, 624.00 MB buffer reserved, lowvram patches: 0
100%|██████████| 4/4 [02:20<00:00, 35.04s/it]
Requested to load AutoencoderKL
Unloaded partially: 976.00 MB freed, 5888.00 MB remains loaded, 624.00 MB buffer reserved, lowvram patches: 127
loaded completely; 200.41 MB usable, 160.31 MB loaded, full load: True
Prompt executed in 168.86 seconds

Other

No response

Metadata

Metadata

Assignees

Labels

Potential BugUser is reporting a bug. This should be tested.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions