diff --git a/nbs/Stable_Audio_API.ipynb b/nbs/Stable_Audio_API.ipynb
index 18fc971..9808e0a 100644
--- a/nbs/Stable_Audio_API.ipynb
+++ b/nbs/Stable_Audio_API.ipynb
@@ -1,491 +1,838 @@
{
- "cells": [
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "cellView": "form",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "F5_PrjeRDnNl",
+ "outputId": "37d66747-99cb-4ebf-c863-1e6f9a5e98c8"
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter your API Key··········\n"
+ ]
+ }
+ ],
+ "source": [
+ "#@title Enter your Stability API key\n",
+ "# @markdown To get your API key visit https://platform.stability.ai/account/keys\n",
+ "import getpass, requests, IPython\n",
+ "STABILITY_KEY = getpass.getpass('Enter your API Key')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "zTSNd1x2PF-0",
+ "outputId": "65c20bd5-a1c4-4cba-bdd5-f443b937ea0e"
+ },
+ "outputs": [
{
- "cell_type": "code",
- "execution_count": 1,
- "metadata": {
- "cellView": "form",
- "id": "F5_PrjeRDnNl"
- },
- "outputs": [],
- "source": [
- "#@title Enter your Stability API key\n",
- "# @markdown To get your API key visit https://platform.stability.ai/account/keys\n",
- "import getpass, requests, IPython\n",
- "STABILITY_KEY = getpass.getpass('Enter your API Key')"
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Saved txt2audio.mp3\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ " \n",
+ " "
+ ],
+ "text/plain": [
+ ""
]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "#@title Stable Audio 2: Text to Audio\n",
+ "\n",
+ "prompt = \"Genre: UK Bass | Instruments: 707 Drum Machine, Strings, 808 bass stabs, Beautiful Synths\" #@param {type:\"string\"}\n",
+ "duration = 190 #@param {type:\"number\"}\n",
+ "seed = 0 #@param {type:\"number\"}\n",
+ "steps = 50 #@param {type:\"number\"}\n",
+ "cfg_scale = 7.0 #@param {type:\"number\"}\n",
+ "output_format = \"mp3\" #@param ['mp3', 'wav'] {type:\"string\"}\n",
+ "response = requests.post(\n",
+ " \"https://api.stability.ai/v2beta/audio/stable-audio-2/text-to-audio\",\n",
+ " headers={\"Authorization\": f\"Bearer {STABILITY_KEY}\", \"Accept\": \"audio/*\"},\n",
+ " files={\"image\": None},\n",
+ " data={\n",
+ " \"prompt\" : prompt,\n",
+ " \"duration\": duration,\n",
+ " \"seed\": seed,\n",
+ " \"steps\": steps,\n",
+ " \"cfg_scale\" : cfg_scale,\n",
+ " \"output_format\": output_format,\n",
+ " \"model\": \"stable-audio-2\"\n",
+ " }\n",
+ ")\n",
+ "if not response.ok:\n",
+ " raise Exception(f\"HTTP {response.status_code}: {response.text}\")\n",
+ "\n",
+ "# Save and show the result\n",
+ "filename = f\"txt2audio.mp3\"\n",
+ "with open(filename, \"wb\") as f:\n",
+ " f.write(response.content)\n",
+ "print(f\"Saved {filename}\")\n",
+ "\n",
+ "IPython.display.display(IPython.display.Audio(filename))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "qLeELUeIPF-0",
+ "outputId": "3571850d-f5be-4e6a-d204-8e8d44fb9912"
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Saved txt2audio.mp3\n"
+ ]
},
{
- "cell_type": "code",
- "execution_count": 2,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Saved txt2audio.mp3\n"
- ]
- },
- {
- "data": {
- "text/html": [
- "\n",
- " \n",
- " "
- ],
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
+ "data": {
+ "text/html": [
+ "\n",
+ " \n",
+ " "
],
- "source": [
- "#@title Stable Audio 2: Text to Audio\n",
- "\n",
- "prompt = \"Genre: UK Bass | Instruments: 707 Drum Machine, Strings, 808 bass stabs, Beautiful Synths\" #@param {type:\"string\"}\n",
- "duration = 190 #@param {type:\"number\"}\n",
- "seed = 0 #@param {type:\"number\"}\n",
- "steps = 50 #@param {type:\"number\"}\n",
- "cfg_scale = 7.0 #@param {type:\"number\"}\n",
- "output_format = \"mp3\" #@param ['mp3', 'wav'] {type:\"string\"}\n",
- "response = requests.post(\n",
- " \"https://api.stability.ai/v2beta/audio/stable-audio-2/text-to-audio\",\n",
- " headers={\"Authorization\": f\"Bearer {STABILITY_KEY}\", \"Accept\": \"audio/*\"},\n",
- " files={\"image\": None},\n",
- " data={\n",
- " \"prompt\" : prompt,\n",
- " \"duration\": duration,\n",
- " \"seed\": seed,\n",
- " \"steps\": steps,\n",
- " \"cfg_scale\" : cfg_scale,\n",
- " \"output_format\": output_format,\n",
- " \"model\": \"stable-audio-2\"\n",
- " }\n",
- ")\n",
- "if not response.ok:\n",
- " raise Exception(f\"HTTP {response.status_code}: {response.text}\")\n",
- "\n",
- "# Save and show the result\n",
- "filename = f\"txt2audio.mp3\"\n",
- "with open(filename, \"wb\") as f:\n",
- " f.write(response.content)\n",
- "print(f\"Saved {filename}\")\n",
- "\n",
- "IPython.display.display(IPython.display.Audio(filename))"
+ "text/plain": [
+ ""
]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "#@title Stable Audio 2.5: Text to Audio\n",
+ "\n",
+ "prompt = \"Genre: UK Bass | Instruments: 707 Drum Machine, Strings, 808 bass stabs, Beautiful Synths\" #@param {type:\"string\"}\n",
+ "duration = 190 #@param {type:\"number\"}\n",
+ "seed = 0 #@param {type:\"number\"}\n",
+ "steps = 8 #@param {type:\"number\"}\n",
+ "cfg_scale = 1.0 #@param {type:\"number\"}\n",
+ "output_format = \"mp3\" #@param ['mp3', 'wav'] {type:\"string\"}\n",
+ "response = requests.post(\n",
+ " \"https://api.stability.ai/v2beta/audio/stable-audio-2/text-to-audio\",\n",
+ " headers={\"Authorization\": f\"Bearer {STABILITY_KEY}\", \"Accept\": \"audio/*\"},\n",
+ " files={\"image\": None},\n",
+ " data={\n",
+ " \"prompt\" : prompt,\n",
+ " \"duration\": duration,\n",
+ " \"seed\": seed,\n",
+ " \"steps\": steps,\n",
+ " \"cfg_scale\" : cfg_scale,\n",
+ " \"output_format\": output_format,\n",
+ " \"model\": \"stable-audio-2.5\"\n",
+ " }\n",
+ ")\n",
+ "if not response.ok:\n",
+ " raise Exception(f\"HTTP {response.status_code}: {response.text}\")\n",
+ "\n",
+ "# Save and show the result\n",
+ "filename = f\"txt2audio.mp3\"\n",
+ "with open(filename, \"wb\") as f:\n",
+ " f.write(response.content)\n",
+ "print(f\"Saved {filename}\")\n",
+ "\n",
+ "IPython.display.display(IPython.display.Audio(filename))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "KuXaEUWsPF-0",
+ "outputId": "cf1a2553-71c7-409a-dc64-514f32a3a579"
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Saved audio2audio.mp3\n",
+ "\n",
+ "Original audio:\n"
+ ]
},
{
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Saved txt2audio.mp3\n"
- ]
- },
- {
- "data": {
- "text/html": [
- "\n",
- "