arXiv:2610.28003cs.AIOct 2026

Manuscript Offprint

arXiv:2610.28003

Dancing Diffusion: Learning Continuous Programs for Image Generation and Editing

Cui Enhe, Jinyue Yang, Bojian Yin, Guoqi Li

ABSTRACT

Diffusion models generate samples through a multi-step denoising trajectory, yet condition every step on the same instruction, so the trajectory cannot be addressed at the level of individual operations. We introduce Dancing Diffusion, which assigns each span of timesteps a dedicated continuous condition block and thereby turns conditioning into a latent program. A compiler maps text features into this program, and a fixed pretrained generator executes its blocks over successive sampling intervals. The trajectory can then dance, keeping its executed history while its continuation is redirected. A shared prefix is executed once and reused, and a later operation is rewritten while content fixed by earlier operations is preserved. The compiler is trained through the images it produces, with visual feedback on both the requested change and the retained content. On SANA, reusing an executed prefix preserves markedly more of the scene than regenerating from noise at a similar strength of edit, learned conditions preserve more background than native prompt switching from the same saved state, and the learned program improves generation quality over native SANA. Later branches weaken the edit, which leaves semantic control over individual operations limited. By converting a single-instruction trajectory into a program of addressable operations, Dancing Diffusion lays a foundation for structured intermediate computation in diffusion models.

1 INTRODUCTION

Diffusion models generate samples through a multi-step denoising trajectory, yet condition every step on the same instruction. Consequently, the trajectory is not addressable at the level of individual operations. In practice, variants that share early operations must recompute them, an edit to one attribute propagates to content the request never mentioned, and intermediate operations can be neither inspected nor corrected.

We introduce Dancing Diffusion, which assigns each span of timesteps a dedicated continuous condition block, turning conditioning into a latent program. A compiler maps text features into this program, and a fixed pretrained generator executes its blocks over successive sampling intervals (Figure 1b). The trajectory thereby becomes addressable at the level of individual operations, and it can dance, keeping its executed history while its continuation is redirected. A shared prefix can be executed once and reused, a later operation can be rewritten while content fixed by earlier operations is preserved, and each block can be intervened on in isolation to test what it controls (Figure 1a).

We formalize when resuming a saved state reproduces the executed history exactly and when a change to future conditions leaves declared background content bounded. The compiler is trained through the images it produces. A visual observer assesses both the requested change and the retention of unrelated content, gradients update only the compiler, and the observer is absent at inference. Temporal conditioning and learned connectors have substantial precedents, including stage-specific prompt representations and timestep-aware language interfaces (Zhang et al., 2023b; Hu et al., 2024; Huberman et al., 2026). Our contribution is the combined compiler–executor formulation and its study under paired edit feedback and controlled suffix interventions.

a Reshaping a generation path

Figure

b Compiler-executor architecture

Figure

Figure 1: Dancing: editing the generation path. (a) A background-only first block produces a common parent, shown as a predicted-clean readout. Both continuations reuse the same saved noisy state and introduce a sailboat or yacht through future conditions. A native same-noise generation is shown for orientation. Curves and intervals are schematic; the images illustrate the operation and are not a final-checkpoint comparison or evidence of native-method superiority. (b) A compiler produces conditions for a shared generator, with training-only feedback from a visual observer.

Our experiments test each of these properties directly. In a controlled setting, learned conditioning changes when content appears, halving the early subject error of a single-expert baseline while deferring background detail. On SANA, resuming a saved state reproduces the source exactly, and rewriting later operations leaves the executed history intact. At an early branch, background LPIPS falls by up to 36% relative to full regeneration, from 0.321 to 0.227 at 6/12/12, while the semantic change is nearly unchanged (0.088 versus 0.092). The reduction holds in every schedule under paired family-bootstrap intervals and is confirmed on all 2376 outputs by independent detector regions that the training observer never sees. From the same saved state, learned conditions preserve more background than native prompt switching in all three schedules, with comparable replacement counts in two of them. These edits do not cost image quality. The learned program lowers FID below native SANA, from 7.349 to 7.145 at 6/12/12, and a shared prefix is computed once for all its continuations. Semantic control over individual operations, however, remains limited, since later branches weaken the edit and interventions on blocks confirm routing rather than a learned semantic factorization. By converting a single-instruction trajectory into a program of addressable operations, Dancing Diffusion lays a foundation for structured intermediate computation in diffusion models.

References (41)