File size: 21,559 Bytes
5b7c261
 
ca0d231
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5b7c261
ca0d231
 
 
 
 
 
 
 
 
 
 
1db3856
 
4de9c17
1db3856
 
 
 
 
ca0d231
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
---
license: mit
language:
- en
pipeline_tag: audio-to-audio
base_model: ACE-Step/Ace-Step1.5
tags:
- audio
- audio-to-audio
- text-to-audio
- music-generation
- music
- diffusion
- streaming-diffusion
- real-time
- tensorrt
- ace-step
- lora
- genai
- "arxiv:2605.28657"
---

# DEMON

**Diffusion Engine for Musical Orchestrated Noise**

DEMON is a real-time streaming diffusion engine for music generation and transformation on top of ACE-Step v1.5.

It is **not a standalone base model**. DEMON is an engine/runtime layer that makes diffusion-based music generation interactive: source audio, prompts, LoRAs, denoise strength, guidance, per-frame curves, and other controls can be changed while generation is already running.

Instead of waiting for one full diffusion generation to finish, DEMON keeps several generations in flight at once using a ring buffer. After warmup, finished latents stream out continuously, making diffusion feel playable.


<p align="center">
  <video controls playsinline preload="none" width="100%" poster="https://raw.githubusercontent.com/daydreamlive/DEMON/refs/heads/main/docs/assets/img/poster-hero.jpg">
    <source src="https://pub-d1b39d9529fd4ef8b125f56716c53163.r2.dev/new_dub_hero.mp4" type="video/mp4">
    Your browser does not support the video tag. Watch the demo at https://music.daydream.live
  </video>
</p>

## Links

- **Try the hosted demo:** https://music.daydream.live
- **Paper:** https://arxiv.org/abs/2605.28657
- **Hugging Face Paper Page:** https://huggingface.co/papers/2605.28657
- **Project page:** https://daydreamlive.github.io/DEMON/
- **Code:** https://github.com/daydreamlive/DEMON
- **Base model:** https://huggingface.co/ACE-Step/Ace-Step1.5

## What is DEMON?

DEMON turns ACE-Step v1.5 into a live, controllable streaming system.

A standard diffusion pipeline usually works like this:

```text
submit request → wait for all denoising steps → decode → hear result
```

DEMON instead works like this:

```text
keep multiple generations in flight → advance them every tick → stream finished latents continuously
```

That means controls can become musical performance parameters instead of offline generation settings.

## Why this matters

Diffusion models are powerful, but they are usually slow, one-shot systems. DEMON makes diffusion-based music generation responsive enough for live control.

You can change parameters while the system is running, including prompt blends, LoRA strength, source preservation, denoise behavior, guidance, velocity scaling, channel guidance, and per-frame modulation curves.

## Highlights

- **Streaming diffusion for ACE-Step v1.5**
- **Ring-buffer scheduling** with multiple in-flight generations
- **TensorRT acceleration** for low-latency ticks
- **Hot-mutable controls** during generation
- **Hot-resizable ring buffer depth**
- **Per-frame modulation curves** at latent-frame resolution
- **Heterogeneous slots**, where each in-flight generation can carry its own seed, denoise schedule, conditioning, CFG mode, curves, and masks
- **Multi-condition compositing**
- **LoRA hot-swapping** without rebuilding the TensorRT decoder engine
- **Windowed VAE decoding** for low-latency audio updates
- **Streaming output is bit-identical to batch output**

## What is in this Hugging Face repo?

This Hugging Face page is the release/model card for DEMON.

DEMON itself is an engine built around ACE-Step v1.5. The full source code, examples, demos, TensorRT build scripts, and documentation are available here:

```text
https://github.com/daydreamlive/DEMON
```

If this Hugging Face repository is used as a release mirror, source paths mentioned below refer to the GitHub repository.

If you are looking for the underlying ACE-Step v1.5 base model, see:

```text
https://huggingface.co/ACE-Step/Ace-Step1.5
```

## Paper and technical notes

- **DEMON paper:** https://arxiv.org/abs/2605.28657
- **FastOobleckDecoder / VAE distillation:** coming soon
- **Latent Channel Semantics / 64-channel VAE characterization:** coming soon

Links will be updated as companion artifacts are released.

## Tested hardware

DEMON has been tested on:

- NVIDIA RTX 3090
- NVIDIA RTX 4090
- NVIDIA RTX 5090

The headline performance numbers below are from an RTX 5090.

## Performance

RTX 5090, ACE-Step v1.5 turbo, all-TensorRT, `depth=4`, `steps=8`, `vae_window=3s`, 60-second source.

| Metric | Value |
|---|---:|
| Tick latency, decoder forward, depth=4 | ~43 ms |
| Windowed VAE decode, 3 s | 4.5 ms |
| Production throughput, depth=4 | 11.3 generations/s |
| Per-frame control resolution | 25 Hz |
| Streaming vs. batch quality | bit-identical output |

The paper reports up to 12.3 decoder completions per second on a single RTX 5090, and 11.3 generations per second at production ring depth 4.

## Requirements

- Python 3.11
- NVIDIA GPU
- ACE-Step v1.5 checkpoints in `checkpoints/`
- Node.js 20+ if running the bundled web demo
- TensorRT 10.16.x for TensorRT acceleration

ACE-Step checkpoints are auto-downloaded on first run where supported.

LoRAs are not auto-downloaded. Drop `.safetensors` LoRA files into:

```text
$ACESTEP_MODELS_DIR/loras/
```

By default this resolves to:

```text
~/.daydream-scope/models/demon/loras/
```

## Setup

Clone the source repository:

```bash
git clone https://github.com/daydreamlive/DEMON.git
cd DEMON
```

Install Python dependencies:

```bash
uv sync
```

Run the main local demo:

```bash
uv run python -u -m demos.realtime_motion_graph_web.run
```

Then open:

```text
http://localhost:6660
```

The launcher starts:

```text
backend: http://localhost:1318
frontend: http://localhost:6660
```

## Hosted demo

If you do not have a local GPU, or just want to try DEMON first, use the hosted instance:

```text
https://music.daydream.live
```

## Running with acceleration backends

The DiT decoder and VAE can choose backends independently.

Supported backend values:

```text
tensorrt
compile
eager
```

Use TensorRT for the fastest path:

```bash
uv run python -u -m demos.realtime_motion_graph_web.run -- --accel tensorrt
```

Use TensorRT for the decoder and eager mode for the VAE:

```bash
uv run python -u -m demos.realtime_motion_graph_web.run -- \
  --accel tensorrt \
  --vae-accel eager
```

Use PyTorch compile mode if you do not want to build TensorRT engines yet:

```bash
uv run python -u -m demos.realtime_motion_graph_web.run -- --accel compile
```

Recommended starting point:

```text
TRT windowed VAE decoder + compile decoder
```

The windowed VAE decoder is the cheapest TensorRT engine to build, is checkpoint- and duration-agnostic, and unlocks low-latency streaming decode.

## Building TensorRT engines

DEMON targets TensorRT 10.16.x.

TensorRT plans are version- and GPU-architecture-specific by default, so rebuild after changing TensorRT, CUDA, driver, or the GPU used for inference.

Build the full matrix:

```bash
uv run python -m acestep.engine.trt.build --all
```

Build 60-second engines only:

```bash
uv run python -m acestep.engine.trt.build --all --duration 60
```

Build only the windowed VAE decoder:

```bash
uv run python -m acestep.engine.trt.build --vae-only --duration 60
```

Preview what would be built:

```bash
uv run python -m acestep.engine.trt.build --all --dry-run
```

Force rebuild:

```bash
uv run python -m acestep.engine.trt.build --all --force-rebuild
```

Force rebuild and ONNX re-export:

```bash
uv run python -m acestep.engine.trt.build --all --duration 60 --force-rebuild --force-onnx
```

TensorRT engine layout:

```text
trt_engines/
  _onnx/
    vae_encode/vae_encode.onnx
    vae_decode/vae_decode.onnx
    decoder/decoder.onnx
    decoder_refit/decoder_refit.onnx

  decoder_mixed_refit_b8_60s/
    decoder_mixed_refit_b8_60s.engine

  vae_decode_fp16_3to30s/
    vae_decode_fp16_3to30s.engine
```

Pass engine paths to `Session` directly:

```python
from acestep.engine.session import Session

session = Session(
    decoder_backend="tensorrt",
    vae_backend="tensorrt",
    vae_window=3.0,
    trt_engines={
        "decoder": "trt_engines/decoder_mixed_refit_b8_60s/decoder_mixed_refit_b8_60s.engine",
        "vae_encode": "trt_engines/vae_encode_fp16_60s/vae_encode_fp16_60s.engine",
        "vae_decode": "trt_engines/vae_decode_fp16_3to30s/vae_decode_fp16_3to30s.engine",
    },
)
```

## Core idea: ring-buffer streaming diffusion

DEMON keeps several generations in flight at different denoising stages.

Each tick advances active slots by one denoising step. After warmup, the system continuously emits completed latents.

Throughput scales with:

```text
depth / steps
```

For example:

```text
depth = 4
steps = 8
```

means the engine can emit completed results at a steady streaming rate once the ring buffer is warm.

## Ring buffer depth

`pipeline_depth` controls how many generations are in flight.

Higher depth:

- smoother parameter sweeps
- more slots in different denoising phases
- higher throughput
- more VRAM and per-tick compute
- slower convergence for some submission-time changes

Lower depth:

- snappier control response
- lower VRAM
- lower per-tick compute
- more discrete changes

Depth can be changed while the system is running:

```python
pipeline.set_depth(n)
```

Active slots drain naturally.

## Song duration and TensorRT profiles

TensorRT engines are profile-specific.

A 240-second engine reserves more workspace than a 60-second engine, even if the current workload is only 60 seconds. Build only the durations you need.

Per-engine peak workspace measured in isolation on RTX 5090:

| Component | 60s engine | 240s engine | Difference |
|---|---:|---:|---:|
| Decoder, refit | 13,511 MB | 15,911 MB | +2,400 MB |
| VAE decode | 10,547 MB | 10,814 MB | +267 MB |
| VAE encode | 4,178 MB | 10,614 MB | +6,436 MB |

These are per-engine peaks captured in separate subprocesses, not a live-runtime sum. At inference time, the decoder peak dominates and the VAE workspaces do not peak alongside it, which is why the live demo fits on a 24 GB card.

The comparison is what matters: switching the three engines from 240 seconds to 60 seconds frees about 9 GB.

## VAE windowing

When `vae_window > 0`, decode happens in overlapped time windows instead of full-length decode.

This is what unlocks low-latency streaming updates: only the requested window is decoded per call rather than the full latent.

Set:

```text
vae_window = 0
```

to use full-length decode.

Set:

```text
vae_window = 3.0
```

to decode three-second windows.

## Programmatic use: Session API

The Session API is the main programmatic surface.

It loads the model once and exposes the core primitives:

```text
prepare_source
encode_text
generate
decode
stream
apply_lora
```

Minimal skeleton:

```python
from acestep.engine.session import Session
from acestep.constants import TASK_INSTRUCTIONS

session = Session(
    decoder_backend="compile",  # "tensorrt", "compile", or "eager"
    vae_backend="compile",      # "tensorrt", "compile", or "eager"
    vae_window=3.0,             # 0 = full decode; >0 = windowed decode
)

# Replace this with your own audio loading.
audio = load_audio("source.wav")

# Load audio, encode it, and extract semantic context.
source = session.prepare_source(audio)

# Encode text conditioning once and reuse it.
cond = session.encode_text(
    tags="deathstep death",
    instruction=TASK_INSTRUCTIONS["cover"],
    refer_latent=source.latent,
    bpm=136,
    duration=60.0,
    key="G# minor",
)

# Generate multiple variants cheaply after warmup.
for seed in [1528, 9999, 42]:
    latent = session.generate(
        conditioning=cond,
        context_latent=source.context_latent,
        source_latent=source.latent,
        seed=seed,
    )

    audio_out = session.decode(latent)

    # Replace this with your own audio saving.
    save_audio(audio_out, f"out_{seed}.wav")
```

## Streaming use

Streaming wraps the same primitives in a `StreamHandle`:

```python
handle = session.stream(
    source=source,
    conditioning=cond,
    pipeline_depth=4,
)

for tick in range(128):
    latent = handle.tick()

    if latent is not None:
        audio = handle.decode(
            latent,
            t_start=0.0,
        )
```

Shared curve overrides bypass normal ring-buffer drain and take effect on the next tick:

```python
handle.pipeline.set_shared_curve("velocity_scale", 1.2)
handle.pipeline.set_shared_curve("sde_denoise_curve", torch.tensor([...]))
```

Revert a shared override:

```python
handle.pipeline.set_shared_curve("velocity_scale", None)
```

## Typed node graph

DEMON exposes a typed node graph for building higher-level applications.

The node graph contains composable operations for:

- latent operations
- audio operations
- conditioning
- curves
- masks
- solver controls
- config
- DCW correction
- channel guidance

The graph is wired through:

```text
NodeDefinition
NodePort
NodeParam
```

Registration validates keyword arguments so applications can safely build on top of the same engine primitives.

This means a CLI, notebook, VST, web demo, MCP tool, or custom protocol can drive the same underlying system.

## Engine features

### Streaming diffusion

`StreamPipeline` maintains a ring buffer of in-flight generations. Each tick runs a batched decoder forward pass that advances active slots by one denoising step.

When CFG is active, the engine runs positive and negative branches as needed.

The decoder dispatches to TensorRT or PyTorch through the same code path.

### Heterogeneous slots

Every in-flight slot carries its own `SlotRequest`.

A slot can have its own:

- seed
- denoise strength
- cached timestep schedule
- source latent
- per-frame curves
- conditioning
- CFG mode
- x0 target
- latent-noise mask

A single ring buffer can mix different request types at the same time.

For example, the same active buffer can contain:

```text
denoise = 1.0 regeneration
denoise = 0.5 style transfer
RCFG-self request
```

and still batch them together in one forward pass.

### Scalar-or-curve modulation

Many controls accept either a scalar or a `[T]` tensor.

Supported scalar-or-curve controls include:

- velocity scale
- SDE re-noise
- ODE noise injection
- guidance scale
- x0 target strength
- x0 target curve
- initial noise mix
- APG momentum
- CFG rescale
- DCW scalers
- condition temporal weights

Values are canonicalized at the boundary so kernels see one consistent shape.

### Channel guidance

Channel guidance applies a `[1, T, 64]` per-channel gain to `xt` before each forward pass.

This has its own surface:

```python
pipeline.set_channel_gain_tensor(...)
```

It is separate from normal `[T]` curve controls because it is both per-channel and per-frame.

### Shared mutable curves

Shared mutable curves override selected curve-shaped fields on every in-flight slot at once.

Supported shared curve names include:

```text
velocity_scale
sde_denoise_curve
ode_noise_curve
apg_momentum
x0_target_strength
cfg_rescale_curve
```

Set a shared curve:

```python
pipeline.set_shared_curve("velocity_scale", 1.2)
```

Revert to per-slot behavior:

```python
pipeline.set_shared_curve("velocity_scale", None)
```

Shared mutable curves take effect on the next tick instead of waiting for new submissions to drain through the ring buffer.

### Multi-condition compositing

Within a single slot, the decoder can run once per active condition and blend velocities per frame using `temporal_weight`.

Conditions can be gated by step range.

Typed entry points include:

```text
ConditioningBlend
ConditioningCombine
```

### CFG modes

DEMON supports three CFG modes:

1. **Standard CFG**  
   Runs an unconditional forward pass every step.

2. **RCFG-initialize**  
   Runs one unconditional forward pass per slot, then caches it for the rest of the schedule.

3. **RCFG-self**  
   Runs zero unconditional forwards. The slot's initial noise stands in as the virtual unconditional velocity.

All three modes support APG momentum and optional per-frame CFG rescale curves.

### Latent-noise-mask inpainting

DEMON supports latent-noise-mask inpainting with two-sided x0 blending:

- pre-blend on `xt`
- post-blend on predicted `x0`

This matches ComfyUI-style semantics and lets the decoder see correctly noised context in preserved regions.

A per-step strength function can be used for progressive masking.

### DCW post-step correction

DEMON includes wavelet-domain sampler-side correction from Yu et al., ported from upstream ACE-Step v0.1.7.

Supported modes:

```text
low
high
double
pix
```

Advanced controls include:

```text
mult_blend
mag_phase
soft_thresh
```

At zero, the advanced surface is byte-identical to the upstream reference.

Update DCW live:

```python
pipeline.set_dcw(...)
```

### Hot LoRA

Register a LoRA directory once, then enable, set strength, or remove LoRAs without rebuilding the system.

When the decoder runs in TensorRT mode, LoRA updates are applied through a refitter against the live engine.

Supported LoRA lifecycle operations include:

```text
register
enable
set_strength
remove
```

### TensorRT acceleration

DEMON can accelerate the DiT decoder, VAE encode, and VAE decode independently.

| Component | Backend | Notes |
|---|---|---|
| Decoder | `tensorrt` | Fastest path. Requires a built decoder engine for the target duration and checkpoint. Refit-enabled engines support LoRA swaps. |
| Decoder | `compile` | Uses `torch.compile`. Long warmup, no TensorRT engine required. |
| Decoder | `eager` | Plain PyTorch. Useful for debugging. |
| VAE encode/decode | `tensorrt` | Fastest VAE path. Windowed decode engine is reused across durations. |
| VAE encode/decode | `compile` | Uses `torch.compile`. |
| VAE encode/decode | `eager` | Plain PyTorch. Useful for debugging. |

## Demo applications

DEMON ships a flagship reference application plus focused examples.

### Realtime motion graph web demo

Run:

```bash
uv run python -u -m demos.realtime_motion_graph_web.run
```

Then open:

```text
http://localhost:6660
```

The web demo lets you:

- feed source audio
- write prompts
- blend two prompts live
- change denoise strength
- hot-swap LoRAs
- blend timbre and structure references
- draw automation curves
- map MIDI controls
- record output
- drive the system through the onboard MCP server

Forward backend flags after `--`:

```bash
uv run python -u -m demos.realtime_motion_graph_web.run -- --accel tensorrt
uv run python -u -m demos.realtime_motion_graph_web.run -- --checkpoint xl
```

### Other examples

```text
examples/session_demo.py
examples/realtime_cover.py
examples/covers/
demos/test_stream_cover_graph.py
```

Feature examples include:

| Script | Feature |
|---|---|
| `cover_basic.py` | Standard cover pipeline |
| `prompt_blend.py` | Two prompts blended with a temporal curve |
| `sde_denoise_curve.py` | Per-frame SDE re-noise modulation |
| `velocity_scaling.py` | Per-frame transformation rate control |
| `lora_generation.py` | LoRA-conditioned generation |
| `x0_target_blend.py` | Two-pass morphing toward a target latent |
| `conditioning_average.py` | Fuse two conditionings |
| `guidance_curve.py` | Per-frame CFG scale |
| `latent_noise_mask.py` | Latent-space inpainting |
| `initial_noise_curve.py` | Per-frame noise/source init mix |
| `ode_noise_injection.py` | Stochastic ODE step |
| `cover_semantic_blend.py` | Blend semantic hints from two sources |
| `x0_target_from_reference.py` | Pre-generate a target latent, then morph toward it |

## Tests

Run:

```bash
uv run pytest tests/ -v
```

## Limitations

- DEMON requires an NVIDIA GPU for practical real-time use.
- TensorRT engines are GPU-, CUDA-, driver-, and TensorRT-version specific.
- TensorRT engines may need to be rebuilt locally.
- Real-time performance depends on GPU, song duration, ring-buffer depth, denoising steps, VAE window size, and selected backend.
- DEMON is an engine around ACE-Step v1.5, not a replacement for the ACE-Step base model.
- Users should review the ACE-Step model card, license, and usage notes before deploying systems built on DEMON.
- Generated audio quality depends on the source audio, prompts, LoRAs, schedule settings, and backend configuration.

## Responsible use

DEMON is intended for creative music generation, live performance, research, prototyping, and audio experimentation.

Users are responsible for ensuring they have the rights to any source audio, prompts, LoRAs, datasets, or generated outputs they use, especially for commercial use.

Do not use DEMON to imitate or misuse the identity, voice, likeness, or creative work of others without appropriate rights or consent.

## Citation

If you use DEMON in your work, please cite the DEMON paper:

```bibtex
@misc{fosdick2026demon,
  title={DEMON: Diffusion Engine for Musical Orchestrated Noise},
  author={Fosdick, Ryan},
  year={2026},
  eprint={2605.28657},
  archivePrefix={arXiv},
  primaryClass={cs.SD},
  url={https://arxiv.org/abs/2605.28657}
}
```

Please also cite ACE-Step when appropriate, since DEMON is built on top of ACE-Step v1.5.

## Acknowledgments

DEMON is built on top of ACE-Step.

The base diffusion model, VAE, text encoder, and 5 Hz language model are ACE-Step's work. Without the ACE-Step team releasing the v1.5 weights and code under MIT, DEMON would not exist.

Thank you to the ACE-Step team for making this work possible.

## Authors

DEMON was originally created by Ryan Fosdick.

Maintained by Daydream Live and contributors.

- Ryan Fosdick: https://ryanontheinside.com
- Daydream Live: https://daydream.live