Skip to content

feat: add basic webui matching stable-audio CLI options#34

Merged
mhrice merged 1 commit into
Stability-AI:mainfrom
IsaacNewtonne:feat/basic-cli-webui
Jun 15, 2026
Merged

feat: add basic webui matching stable-audio CLI options#34
mhrice merged 1 commit into
Stability-AI:mainfrom
IsaacNewtonne:feat/basic-cli-webui

Conversation

@IsaacNewtonne

Copy link
Copy Markdown
Contributor

Summary:
Adds a minimal Gradio WebUI that maps directly to the main stable-audio CLI options, intended as a simple UI path for users who want CLI-parity controls.

What’s included
- New basic UI module:
  - stable_audio_3/interface/basic_cli_webui.py
- New launcher:
  - run_basic_webui.py
- README quick-start addition for launching the basic web UI.

Exposed controls (CLI parity focus)
- Model/runtime: --model, --device, --no-half
- Generation: --prompt, --negative-prompt, --duration, --steps, --cfg-scale, --seed, --batch-size
- Audio-to-audio: --init-audio, --init-noise-level
- Inpainting/continuation: --inpaint-audio, --inpaint-start, --inpaint-end (supports comma-separated multi-region input in UI)
- Decode/LoRA: chunked decode mode, --lora-ckpt-path, --lora-strength, --lora-index
- Output: WAV export/download

Validation
- python -m compileall stable_audio_3/interface/basic_cli_webui.py run_basic_webui.py

@mhrice

mhrice commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this contribution! I wonder if you think it would just be better to merge this into the existing gradio ui?
It seems like the only main features that we've missing there is multiple inpainting, model switching, and batch size?

@IsaacNewtonne IsaacNewtonne force-pushed the feat/basic-cli-webui branch from 218ac78 to 929f231 Compare June 13, 2026 10:20
@IsaacNewtonne

Copy link
Copy Markdown
Contributor Author

Thanks, that makes sense. I revised the PR to merge the missing functionality into the existing Gradio UI instead of
adding a separate UI.

Updated scope:

  • Adds a visible batch size control to the existing Gradio interface.
  • Replaces single inpaint start/end sliders with comma-separated start/end fields so multiple inpainting regions are
    supported.
  • Removes the separate basic webui launcher/module.
  • Adds focused tests for inpaint region parsing.

I left model selection as a launch-time option for now since the existing UI is built around the loaded model’s
config/objective and LoRA state.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for specifying multiple inpainting regions in the Gradio UI by switching the inpaint start/end inputs to comma-separated text fields and introducing a shared parser/validator for those region inputs.

Changes:

  • Added parse_inpaint_regions() to parse/validate comma-separated inpaint start/end regions and wired it into generate_cond().
  • Updated the Gradio UI to use textboxes for inpaint regions and added a batch size control.
  • Added unit tests for parse_inpaint_regions().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
stable_audio_3/interface/diffusion_cond.py Adds region CSV parsing/validation, updates generate args, and adjusts Gradio inputs (inpaint + batch size).
tests/test_gradio_interface.py Adds tests covering single/multi/empty/invalid inpaint region parsing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +27 to +32
def parse(value):
values = [item.strip() for item in str(value or "").split(",") if item.strip()]
try:
return [float(item) for item in values]
except ValueError as exc:
raise gr.Error("Inpaint regions must be comma-separated numbers.") from exc
"cfg_interval": (cfg_interval_min, cfg_interval_max),
"lora_configs": lora_configs,
"batch_size": batch_size,
"batch_size": int(batch_size),
Comment on lines +25 to +27
def test_parse_invalid_inpaint_regions(starts, ends):
with pytest.raises(Exception):
parse_inpaint_regions(starts, ends)
Comment on lines +25 to +27
def parse_inpaint_regions(starts_csv, ends_csv):
"""Parse matching comma-separated inpaint start/end regions."""
def parse(value):
@mhrice

mhrice commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Looks good, thanks!

@mhrice mhrice merged commit 8b92042 into Stability-AI:main Jun 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants