/ Модель

Характеристики

Лицензия
Apache 2.0
Библиотека
diffusers
Опубликована
22 сен 2026

spansynth-edit

Обработка аудиоАудио → аудио3 профессии

SpanSynth-Edit синтезирует музыку по MIDI и редактирует ноты в записи с учётом окружающего аудиоконтекста.

59скачиваний за 30 дней3лайкавеса обновлены23 сен 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

SpanSynth-Edit — модель для синтеза и редактирования музыкальных аудиозаписей по MIDI, опубликованная пользователем mimbres. Она создаёт музыку по MIDI-партитуре или перегенерирует выбранный фрагмент записи после изменения нот в MIDI. Для синтеза использует аудиоконтекст вокруг фрагмента, чтобы согласовать тембр; доступны обычный режим редактирования и режим FlowEdit. Модель работает с MIDI-программами инструментов и группами объединённых инструментов, а также поддерживает партии ударных.

Модель поставляется в формате Diffusers с весами Safetensors и использует архитектуру SpanSynthEditPipeline; для работы нужны PyTorch и пакет spansynth. Выход — аудио 48 кГц, моно. В README описана работа на NVIDIA GPU, Apple Silicon и CPU; для GPU рекомендованы 6 ГБ видеопамяти. Лицензия — Apache-2.0. README не сообщает размер модели, длину контекста или языки текста: модель предназначена для музыкального аудио и MIDI, а не для обработки естественного языка.

Сценарии применения

  • синтез аудио по MIDI-партитуре
  • замена нот в выбранном фрагменте музыкальной записи
  • добавление нот в существующую аранжировку
  • удаление или изменение партий инструментов в записи
  • прослушивание вариантов MIDI-аранжировки с тембровой подсказкой из записи

Ограничения

Для редактирования нужны согласованные аудио и MIDI, а режим FlowEdit требует исходную MIDI-партитуру. Обрабатывается один фрагмент за запуск; выходное аудио — моно 48 кГц.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Synthesise music from MIDI, or add, remove, and modify notes in a recording by revising its MIDI. SpanSynth-Edit generates the selected region, using surrounding audio for timbre guidance.

Try it in your browser: upload audio, transcribe with YourMT3+, edit the piano roll, and generate. See the local web setup to run the app yourself. You can also use the ComfyUI workflow and piano-roll editor.

Install

System requirements

  • Python: 3.11–3.13 with PyTorch.
  • NVIDIA GPU: CUDA with bfloat16 support. 6 GB VRAM recommended.
  • Apple Silicon GPU: supported through Metal (PyTorch MPS). Tested on an M1 Pro with 16 GB unified memory and PyTorch 2.13.
  • CPU inference is also supported.

Measured peak VRAM was about 3.9 GiB on a GH200 for synthesis and both editing methods with default settings (20.48 s crop, 16 steps, CFG 2.0).

Install PyTorch for your GPU first, then install the CLI without downloading the demo audio:

git clone --depth 1 --filter=blob:none --sparse https://github.com/mimbres/spansynth-edit.git
cd spansynth-edit
git sparse-checkout set spansynth
python -m pip install .

Model and codec weights download automatically on first use. No token is required.

Diffusers

Install the optional integration:

python -m pip install '.[diffusers]'

Download the example files, then edit the selected region:

import soundfile as sf
from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained(
    'mimbres/spansynth-edit',
    custom_pipeline='pipeline',
    trust_remote_code=True,
).to('cuda')
result = pipe(
    audio='../spansynth-inputs/early-slakh-track00006-original.mp3',
    midi='../spansynth-inputs/early-slakh-track00006-after.mid',
    num_inference_steps=16,
    guidance_scale=2.0,
)
sf.write('edited.wav', result.audios[0, 0], result.sample_rate, subtype='FLOAT')

Use .to('mps') for Apple Silicon or .to('cpu') for CPU. For FlowEdit, add method='flowedit' and source_midi pointing to the original score. The pipeline also accepts the crop, region, MIDI offset, and context options described below. This custom pipeline uses the installed spansynth package. Pass custom_pipeline='pipeline' to load the repository's pipeline.py implementation. Save and reopen the pipeline locally with:

pipe.save_pretrained('saved-pipeline')
pipe = DiffusionPipeline.from_pretrained(
    'saved-pipeline', custom_pipeline='pipeline', trust_remote_code=True,
)

Try an example

Defaults: spansynth-edit · 16 Euler steps · CFG 2.0 Audio context enabled · Context MIDI omitted

Example files

From the repository directory, download the sample audio and its original and revised MIDI files (about 0.5 MB total):

mkdir -p ../spansynth-inputs
for name in early-slakh-track00006-original.mp3 \
            early-slakh-track00006-before.mid \
            early-slakh-track00006-after.mid; do
  curl --fail --location --output "../spansynth-inputs/$name" \
    "https://raw.githubusercontent.com/mimbres/spansynth-edit/main/demo/assets/$name"
done

The examples below regenerate 6.40–14.08 s within the first 20.48 s of the recording.

spansynth-edit

Provide the full revised MIDI, including notes that should remain unchanged within the selected region:

spansynth-edit edit \
  --audio ../spansynth-inputs/early-slakh-track00006-original.mp3 \
  --midi ../spansynth-inputs/early-slakh-track00006-after.mid \
  --cfg 2.0 \
  --output ../spansynth-results/slakh-edit

spansynth-edit + flowedit

Provide both the original and revised MIDI:

spansynth-edit edit --method flowedit \
  --audio ../spansynth-inputs/early-slakh-track00006-original.mp3 \
  --source-midi ../spansynth-inputs/early-slakh-track00006-before.mid \
  --midi ../spansynth-inputs/early-slakh-track00006-after.mid \
  --output ../spansynth-results/slakh-flowedit

Synthesis

Synthesise the original score in the selected region, using the surrounding recording as audio context:

spansynth-edit synthesize \
  --audio ../spansynth-inputs/early-slakh-track00006-original.mp3 \
  --midi ../spansynth-inputs/early-slakh-track00006-before.mid \
  --output ../spansynth-results/synthesis

Add --check-inputs to validate audio, MIDI, and timing without loading the model.

Options

Common options are listed below. Flags marked off are enabled by adding them to the command. For all options, run spansynth-edit edit --help or spansynth-edit synthesize --help.

Generation

OptionDefaultUse
--methodordinaryordinary selects spansynth-edit; flowedit selects spansynth-edit + flowedit. Available with edit only.
--cfg2.0MIDI classifier-free guidance scale (0 or higher).
--steps16Number of Euler steps.
--context-midioffUse original MIDI outside the generated region. Requires --source-midi.
--drop-context-audiooffDrop the audio-context condition. Audio outside the generated region is still preserved.

Inputs and timing

All times are in seconds.

OptionDefaultUse
--audiorequiredSource recording or audio context.
--midirequiredTarget MIDI: the score to synthesise or the revised score.
--source-midinoneOriginal MIDI, required for spansynth-edit + flowedit or --context-midi.
--crop-start0.0Crop start on the audio timeline.
--duration20.48Crop length, up to 20.48 seconds.
--edit-start, --edit-end6.40, 14.08Generated region relative to the crop.
--midi-offset0.0Offset added to target MIDI times to obtain audio times.
--source-midi-offset0.0Offset added to original MIDI times to obtain audio times.

Execution and output

OptionDefaultUse
--outputrequiredFolder for generated audio and run settings.
--deviceautoChoose cpu, mps (Apple GPU), cuda, or cuda:N. auto tries CUDA, then MPS, then CPU.
--overwriteoffReplace existing results in the output folder.

Timing and instruments

Provide aligned audio and MIDI, or use the offsets to align their timelines.

With --crop-start 30, a MIDI note at 36.4 s appears at 6.4 s in the crop. If MIDI time 0 corresponds to the start of that crop, use --midi-offset 30. Set --source-midi-offset independently for the original MIDI. Each run processes one crop, with edit boundaries rounded outward to 40 ms.

The instrument vocabulary lists supported MIDI programs and merged instrument groups. Programs in a group share one model category: for example, 0, 1, 3, 6, and 7 map to Acoustic Piano. Program numbers are zero-based, and MIDI channel 10 selects drums (internal program 128).

Results

FileContents
output.wavFull crop with the synthesised or edited region
generated.wavGenerated region only
input.wavSource crop converted to 48 kHz mono
run.jsonSettings and timing

All audio outputs are 48 kHz mono. Outside the generated region, output.wav matches input.wav exactly. Use --overwrite to replace existing results.

License and credits

Code and model weights are released under Apache-2.0. See LICENSE and NOTICE for terms and credits, including YourMT3+ and HeartCodec (code license, weight license). Demo recordings retain their original rights.

Training data retain their own licenses, including MAESTRO's CC BY-NC-SA 4.0 terms. The repository's Apache-2.0 license does not replace these dataset terms.

Citation

If you use SpanSynth-Edit in your research, please cite our paper:

@misc{chang2026spansynthedit,
  title={Synthesis and editing of multi-instrument audio mixtures using scalar-quantised latents with {MIDI Span} conditioning},
  author={Sungkyun Chang and Keshav Bhandari and Simon Dixon and Emmanouil Benetos},
  year={2026},
  eprint={2609.25546},
  archivePrefix={arXiv},
  primaryClass={cs.SD},
  url={https://arxiv.org/abs/2609.25546}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · diffusers

Нельзя запустить

Обработка «аудио → аудио» пока не поддерживается.

Ревизия весов
9a3eff8

0 моделей