ComfyUI/comfy_execution
PR Author 983d6a1566 Support bounded feedback loops in the DAG execution engine
Allow sampler nodes' internal iteration variables (e.g. step_index)
to flow back upstream through ComfyMathExpression nodes to control
per-step parameters (cfg, s_noise, eta, r) without triggering a
dependency cycle error.

Architecture: Two-level cycle handling
- Static validation: _is_bounded_feedback_cycle() allows cycles
  where any node declares BOUNDED_FEEDBACK
- Graph building: _is_feedback_output() skips strong links for
  declared feedback sockets, records them in feedback_links

Multi-hop chain walking via _build_feedback_fns() resolves
expression->CFGGuider/Sampler chains with simple_eval + MATH_FUNCTIONS,
composing per-step fn(step, total_steps) callables.

Sampler functions now re-read s_noise/eta/r each iteration via
_init_dynamic_options() / _refresh_dynamic_params() / _apply_dynamic_s_noise().
KSAMPLER.sample() conditionally injects mutable extra_options ref.

Safety: _dynamic_sampler_options popped at function top before model() calls.
One-line opt-in: BOUNDED_FEEDBACK = {'step_index'} on any node.
2026-06-19 18:56:13 +08:00
..
asset_enrichment.py feat(assets): include asset id in executed WebSocket message (#13862) 2026-06-10 17:04:52 -07:00
cache_provider.py Revert "Revert "feat: Add CacheProvider API for external distributed caching"" (#12915) 2026-03-12 21:17:50 -07:00
caching.py dynamicVRAM + --cache-ram 2 (CORE-117) (#13603) 2026-04-28 19:15:02 -04:00
graph_utils.py V3 Node Schema Definition - initial (#8656) 2025-07-31 18:02:12 -04:00
graph.py Support bounded feedback loops in the DAG execution engine 2026-06-19 18:56:13 +08:00
jobs.py revert(assets): drop job_ids filter from GET /api/assets (#14408) 2026-06-10 19:23:01 -07:00
progress.py Remove useless annotations imports. (#14105) 2026-05-25 19:23:29 -07:00
utils.py Support for async node functions (#8830) 2025-07-10 14:46:19 -04:00
validation.py Remove useless annotations imports. (#14105) 2026-05-25 19:23:29 -07:00