Comfy-Org / Comfy-Org/ComfyUI

Lazy V3 Autogrow inputs are scheduled as ordinary dependencies

Open
#15,853 0 comments 0 reactions 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

This affects ComfyUI's core dependency scheduler. A UI reproduction currently requires a V3 node that combines `io.Autogrow` with lazy template inputs because no first-party node currently exposes that combination.

A minimal regression test that defines the affected schema directly is included in PR #15103 and does not depend on an installed custom node.

### Expected Behavior

Expanded inputs created from an `io.Autogrow` template declared with `lazy=True` should remain lazy dependencies.

Before `check_lazy_status` requests an expanded input, none of its connected upstream nodes should be scheduled. When it requests one input, only that input's upstream dependency should execute.

### Actual Behavior

All connected Autogrow inputs are scheduled as ordinary dependencies before `check_lazy_status` can select one.

V3 dynamic inputs are finalized for validation and execution, but dependency discovery consults the node's raw input schema. Expanded input names such as `values.value0` are absent from that schema, so their `lazy` metadata is not found.

### Steps to Reproduce

1. Install or enable [ComfyUI-LazyFallbackSwitch](https://github.com/SparknightLLC/ComfyUI-LazyFallbackSwitch).
2. Add `Lazy Fallback Switch (Autogrow)`.
3. Connect independently executable upstream nodes to at least two `valueN` inputs.
4. Set `index` to select one of those inputs.
5. Connect the switch output to an output or preview node.
6. Queue the workflow with the upstream results uncached.
7. Observe that every connected `valueN` branch executes, rather than only the selected branch.

### Debug Logs

```powershell
No exception or warning is emitted. The queue completes normally; the defect is that unnecessary upstream branches execute.
```

### Other

PR #15103 fixes the problem by caching each node's finalized live input schema in `TopologicalSort` and using it when determining whether an input link is lazy.

The PR includes a focused regression test verifying that:

- neither lazy Autogrow route is initially scheduled;
- requesting one expanded route schedules only its source;
- the other connected route remains inactive.

Contributor guide

Open the contributing guide

Research direction

Start with TopologicalSort's dependency discovery and the finalized live input schema described in PR #15103; inspect how check_lazy_status requests expanded Autogrow routes. Run the focused regression test from PR #15103 and confirm that lazy routes are initially unscheduled, selecting one route schedules only its source, and the other remains inactive.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.