Sign inSign up

zbhavyai/melody-engine

By zbhavyai

Updated 9 months ago

Prompt based instrumental music generation

Image
Machine learning & AI
0

1.5K

zbhavyai/melody-engine repository overview

Melody Engine

Melody Engine is a thin but practical wrapper on MagentaRT, providing:

  1. REST API for programmatic music generation
  2. Serialized job queue to avoid GPU thrashing
  3. Containerized runtime for reproducible deployment
  4. Web interface that hides MagentaRT’s operational complexity

🧰 Requirements

To run Melody Engine, you would need

  • a machine with a powerful Nvidia GPU, and
  • a linux host with podman or docker installed.

MagentaRT's official repository suggests a GPU with at least 40GB VRAM, but as per my limited experiments, NVIDIA RTX A5000 with 24GB VRAM works just fine.

🚀 How to use this image

  1. Pull the latest image.

    podman image pull docker.io/zbhavyai/melody-engine:latest
    
  2. Create output and cache directories on the host

    mkdir -p "$(pwd)/outputs" && mkdir -p "$HOME/.cache/melody-engine"
    
  3. Run the container. This will load MagentaRT on your GPU and start a uvicorn server on port 8080.

    podman container run \
       --detach \
       --name melody-engine \
       --restart unless-stopped \
       --publish 8080:8080 \
       --security-opt=label=disable \
       --env TF_GPU_ALLOCATOR=cuda_malloc_async \
       --device=nvidia.com/gpu=all \
       --volume "$(pwd)/outputs:/opt/app/outputs:rw,Z" \
       --volume "$HOME/.cache/melody-engine:/magenta-realtime/cache:rw,Z" \
       docker.io/zbhavyai/melody-engine:latest
    
  4. Access the web interface at localhost:8080 or explore the API documentation at localhost:8080/docs.

  5. Generated audio files are saved locally in the outputs directory, or can be downloaded from the web interface or REST API.

👨‍💻 Source code

The source code is here: zbhavyai/melody-engine. Please star the repository if you come across it ⭐

You may also choose to sponsor it here if you would like to show your support 🤜🤛

Tag summary

Content type

Image

Digest

sha256:b4318cf38

Size

7.2 GB

Last updated

9 months ago

docker pull zbhavyai/melody-engine