Stable Audio 1.0 Guide (LEAKED EDITION)

petra

INSTALLATION

1
2
3
4
5
6
git clone https://github.com/Stability-AI/stable-audio-tools
cd stable-audio-tools/
python3 -m venv venv
source venv/bin/activate
pip install .
mkdir models

ORIGINAL UPLOAD WAS DELETED, COMPLETELY CONFIRMING IT'S AUTHENTICITY

hfjannies

DOWNLOADING THE MODEL

ORIGINAL (DELETED) https://huggingface.co/vgdasfgadg/hi/tree/main
REUPLOAD: https://huggingface.co/llama-anon/petra-hi-small/tree/main
REUPLOAD (TORRENT):
magnet:?xt=urn:btih:f119ba1a2209be8838a10a6575803036ddd71905&xt=urn:btmh:1220434ff0b6f9976f8b2b12d42db30c2d699981c066e852d711043ad1f50ee5b7a3&dn=StableAudio10&tr=udp%3A%2F%2Fopen.tracker.cl%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce (note: I haven't confirmed the authenticity of this torrent, use at your own risk)
Download the model.ckpt and model_config.json into stable-audio-tools/models

(OPTIONAL) DISABLE GRADIO ANALYTICS

install requests
pip install requests
Download the file from https://files.catbox.moe/31eaww.py

wget https://files.catbox.moe/31eaww.py
mv 31eaww.py run_gradio.py

Or copy the contents manually into run_gradio.py

import requests
import os
os.environ['GRADIO_ANALYTICS_ENABLED'] = 'False'
def my_get(url, **kwargs):
    kwargs.setdefault('allow_redirects', True)
    return requests.api.request('get', 'http://127.0.0.1/', **kwargs)
original_get = requests.get
requests.get = my_get
from stable_audio_tools import get_pretrained_model
from stable_audio_tools.interface.gradio import create_ui
import json 

import torch
requests.get = original_get



def main(args):
    torch.manual_seed(42)

    interface = create_ui(
        model_config_path = args.model_config, 
        ckpt_path=args.ckpt_path, 
        pretrained_name=args.pretrained_name, 
        pretransform_ckpt_path=args.pretransform_ckpt_path,
        model_half=args.model_half
    )
    interface.queue()
    interface.launch(share=False, auth=(args.username, args.password) if args.username is not None else None)

if __name__ == "__main__":
    import argparse
    parser = argparse.ArgumentParser(description='Run gradio interface')
    parser.add_argument('--pretrained-name', type=str, help='Name of pretrained model', required=False)
    parser.add_argument('--model-config', type=str, help='Path to model config', required=False)
    parser.add_argument('--ckpt-path', type=str, help='Path to model checkpoint', required=False)
    parser.add_argument('--pretransform-ckpt-path', type=str, help='Optional to model pretransform checkpoint', required=False)
    parser.add_argument('--username', type=str, help='Gradio username', required=False)
    parser.add_argument('--password', type=str, help='Gradio password', required=False)
    parser.add_argument('--model-half', action='store_true', help='Whether to use half precision', required=False)
    args = parser.parse_args()
    main(args)

(OPTIONAL) SPEEDUPS

1
2
3
source venv/bin/activate
pip install wheel
pip install flash_attn

doesn't do much for me, ymmv

RUNNING THE MODEL

source venv/bin/activate
python run_gradio.py --ckpt-path ./models/model.ckpt --model-config ./models/model_config.json

STEPS AND SAMPLERS

STEPS
According to the Stable Audio 1.0 paper, 50 steps is enough [1] Appendix A (P. 12)

SAMPLERS
From my own testing, the only good samplers are dpmpp-3m-sde, dpmpp-2m-sde and k-dpmpp-2s-ancestral.
dpmpp-3m-sde and dpmpp-2m-sde are more or less the same, k-dpmpp-2s-ancestral sometimes provides better results but comes at a performance cost (50% slower inference)
ymmv

GRAB IT WHILE ITS HOT AND HAVE FUN!

agplv3
The rentry is governed under an AGPLv3 license.

Edit Report
Pub: 25 May 2024 22:44 UTC
Edit: 29 May 2024 11:54 UTC
Views: 5116