Spiral gives your agent every tool with one account. Browse the tools →

opencode · Audio

How to Use Stable Audio 3 Medium Base Audio Inpainting in opencode

Stable Audio 3 Medium Base Audio Inpainting replaces selected audio sections or continues a recording. Unlike Stable Audio 3 Medium, it uses the pre-trained checkpoint intended for fine-tuning, with about 50 sampling steps as a starting point.

Prompts to try with Stable Audio 3 Medium Base Audio Inpainting in opencode

Copy an example into opencode, or ask in your own words.

Use Stable Audio 3 Medium Base Audio Inpainting on assets/audio/menu.wav. Replace seconds 12 through 18 with a restrained piano passage matching the surrounding music; keep the total length at 30 seconds.

Stable Audio 3 Medium Base Audio Inpaintingopencode
Try asking
  • Use Stable Audio 3 Medium Base Audio Inpainting to extend assets/audio/intro.wav from 20 to 30 seconds with the same quiet acoustic guitar texture and relaxed mood.

  • Use Stable Audio 3 Medium Base Audio Inpainting on the project's 30-second drum cue. Replace seconds 20 through 24 with a restrained fill matching the existing beat, starting with 50 sampling steps and guidance 7.

  • Use Stable Audio 3 Medium Base Audio Inpainting to regenerate seconds 8 through 14 of assets/audio/forest.wav with soft wind and distant birds consistent with the surrounding ambience; retain the 30-second duration.

  • Use Stable Audio 3 Medium Base Audio Inpainting on assets/audio/impact.wav. Regenerate seconds 1 through 3 as a heavier wooden impact with a short decay; preserve the surrounding audio and five-second total length.

How to set up Stable Audio 3 Medium Base Audio Inpainting in opencode

Pick the way that suits you. Each takes about two minutes.

Use Spiral's MCP server

  1. Add the server

    Leave out --global to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

    opencode mcp add spiral --global --url https://api.spiral.ai/mcp
  2. Sign in

    Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, /mcps starts the same sign-in.

    opencode mcp auth spiral
  3. Check it

    Spiral shows as connected.

    opencode mcp list

Use the Spiral skill

  1. Send opencode this message

    Your agent reads Spiral's skill and sets itself up.

    set up https://spiral.ai/SKILL.md
  2. Sign in or paste a key

    Approve Spiral in the browser, or give the agent a key from the console.

Use the Spiral CLI

  1. Install and sign in

    Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

    npx -y spiral-cli@latest init

Call the Spiral API

  1. Create an API key

    In the console, under API keys.

  2. Run Stable Audio 3 Medium Base Audio Inpainting

    One request; the result comes back by polling or a webhook.

    curl https://api.spiral.ai/v1/runs \
      -H "Authorization: Bearer $SPIRAL_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "provider": "fal",
        "model": "fal-ai/stable-audio-3/medium/base/audio-inpainting",
        "input": {
          "prompt": "punchy kick drum fill",
          "audio_url": "https://storage.googleapis.com/falserverless/model_tests/diffrythm/rock_en.wav",
          "mask_start_seconds": 4,
          "mask_end_seconds": 8
        }
      }'

Then paste one of the prompts above: opencode finds Stable Audio 3 Medium Base Audio Inpainting on Spiral, shows the price and runs it.

Stable Audio 3 Medium Base Audio Inpainting providers and prices

Spiral runs Stable Audio 3 Medium Base Audio Inpainting through fal. Open a card for today's price, with every fee included.

falAudio
Stable Audio 3 Medium Base Audio Inpainting · Audio Inpainting Medium Base
fal-ai/stable-audio-3/medium/base/audio-inpainting

Settings you can ask for

Stable Audio 3 Medium Base Audio Inpainting works from your prompt and audio URL. Ask opencode for any of these in your prompt.

SettingAllowed valuesDefaultDescription
Negative promptwhat to leave out, in words

Text description of qualities to avoid in the output.

Number of inference steps1 to 10050

Number of sampling steps. Base (non-distilled) checkpoints typically need ~50 for good quality.

Guidance scale0 to 257

Classifier-free guidance scale. Higher values follow the prompt more strictly; ~7.0 is a good starting point for base checkpoints.

Seeda whole number

Random seed for reproducible outputs. Omit for a random seed.

Enable prompt expansionon or offoff

If True, the prompt will be expanded using an LLM for more detailed and higher quality results.

Output formatmp3, wav, flac, ogg, opus, m4a, or aacmp3

Container format for the generated audio output.

Mask start seconds0 to 380

Start of the region to regenerate, in seconds.

Mask end seconds0 to 380

End of the region to regenerate, in seconds.

Every API field of Stable Audio 3 Medium Base Audio Inpainting · Audio Inpainting Medium Base is on its tool page: open its card above.

What can you do with Stable Audio 3 Medium Base Audio Inpainting in opencode?

You can revise game audio, demo music, and sound effects already in your project. Have the agent identify the passage to change and describe replacement audio that fits its surroundings.

Replace a drum fill

Rework a selected drum passage in an instrumental track. Describe a fill that fits the existing tempo, instrumentation, and energy.

Extend a podcast music bed

Continue an existing instrumental bed to cover a longer introduction. Request the same restrained instrumentation and mood.

Fill an ambient passage

Regenerate a selected section of an ambient recording for a game scene. Keep the requested sounds consistent with the surrounding environment.

Rework a video outro

Replace the ending of an instrumental cue with a quieter passage. Preserve the earlier music while trying a different closing arrangement.

Audition a different bridge

Try a new middle section in an unfinished composition. Request a change in instrumental texture that still fits the surrounding track.

Revise a sound effect

Regenerate a selected portion of an existing effect, such as an impact or mechanical sound. Describe the desired character without replacing the entire recording.

Questions about Stable Audio 3 Medium Base Audio Inpainting in opencode

Can opencode use Stable Audio 3 Medium Base Audio Inpainting?

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run Stable Audio 3 Medium Base Audio Inpainting like any built-in tool.

How much does Stable Audio 3 Medium Base Audio Inpainting cost in opencode?

$0.06981 per run at the default inputs. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.

Do I need a fal account to use Stable Audio 3 Medium Base Audio Inpainting in opencode?

No. Spiral runs Stable Audio 3 Medium Base Audio Inpainting on its own fal account. You sign in to Spiral once and never paste a key.

How long does it take to set up Stable Audio 3 Medium Base Audio Inpainting in opencode?

About two minutes: add the server, then sign in, then check it.

Does opencode wait while Stable Audio 3 Medium Base Audio Inpainting runs?

Stable Audio 3 Medium Base Audio Inpainting runs in the background. opencode starts the run, checks on it and gives you the audio when it's ready.

What does audio inpainting change?

It regenerates a selected section using your description and the surrounding recording. Audio outside the selected region is preserved, so you can revise a passage without rebuilding the entire track.

Can it continue an unfinished recording?

Yes. Stable Audio 3 supports continuing existing recordings, which makes it useful for extending an instrumental bed, an outro, or an ambient passage.

Can it generate narration or spoken dialogue?

Stable Audio 3 is not designed for speech or voice generation. Use it for instrumental passages and sound edits rather than narration.

Which language should I use for prompts?

Write audio descriptions in English. Stability AI says the model was trained on English descriptions and that other languages will underperform.

How should I describe a replacement section?

Describe the sound you want, including instruments, genre, mood, and tempo where relevant. Keep the request plausible for the surrounding audio, such as a restrained drum fill within an existing jazz passage.

Get started

Start using Stable Audio 3 Medium Base Audio Inpainting in opencode

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into opencode:

Set up opencode

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options