Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions nbs/Stable_Image_API_Public.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
"\n",
"- Ultra: Our most advanced text to image generation service. This service will use 8 credits.\n",
"\n",
"- SD3.0 & SD3.5: This service will use 6.5 credits for SD3/3.5 Large, 4 credits for SD3/3.5 Large Turbo, 3.5 credits for SD3 Medium.\n",
"- SD3.5: This service will use 6.5 credits for SD3.5 Large, 4 credits for SD3.5 Large Turbo, 3.5 credits for SD3.5 Medium.\n",
"\n",
"- Core: Our primary service for text-to-image generation. This service will use 3 credits.\n",
"\n",
Expand Down Expand Up @@ -252,6 +252,7 @@
"negative_prompt = \"\" #@param {type:\"string\"}\n",
"aspect_ratio = \"3:2\" #@param [\"21:9\", \"16:9\", \"3:2\", \"5:4\", \"1:1\", \"4:5\", \"2:3\", \"9:16\", \"9:21\"]\n",
"seed = 0 #@param {type:\"integer\"}\n",
"style_preset = \"None\" #@param [\"None\", \"3d-model\", \"analog-film\", \"anime\", \"cinematic\", \"comic-book\", \"digital-art\", \"enhance\", \"fantasy-art\", \"isometric\", \"line-art\", \"low-poly\", \"modeling-compound\", \"neon-punk\", \"origami\", \"photographic\", \"pixel-art\", \"tile-texture\"]\n",
"output_format = \"jpeg\" #@param [\"webp\", \"jpeg\", \"png\"]\n",
"\n",
"host = f\"https://api.stability.ai/v2beta/stable-image/generate/ultra\"\n",
Expand All @@ -264,6 +265,9 @@
" \"output_format\": output_format\n",
"}\n",
"\n",
"if style_preset != \"None\":\n",
" params[\"style_preset\"] = style_preset\n",
"\n",
"response = send_generation_request(\n",
" host,\n",
" params\n",
Expand Down Expand Up @@ -344,6 +348,7 @@
"prompt = \"op art cat illusion red blue chromostereopsis maximum saturation\" #@param {type:\"string\"}\n",
"negative_prompt = \"\" #@param {type:\"string\"}\n",
"aspect_ratio = \"21:9\" #@param [\"21:9\", \"16:9\", \"3:2\", \"5:4\", \"1:1\", \"4:5\", \"2:3\", \"9:16\", \"9:21\"]\n",
"style_preset = \"None\" #@param [\"None\", \"3d-model\", \"analog-film\", \"anime\", \"cinematic\", \"comic-book\", \"digital-art\", \"enhance\", \"fantasy-art\", \"isometric\", \"line-art\", \"low-poly\", \"modeling-compound\", \"neon-punk\", \"origami\", \"photographic\", \"pixel-art\", \"tile-texture\"]\n",
"seed = 0 #@param {type:\"integer\"}\n",
"output_format = \"jpeg\" #@param [\"webp\", \"jpeg\", \"png\"]\n",
"\n",
Expand All @@ -357,6 +362,9 @@
" \"output_format\": output_format\n",
"}\n",
"\n",
"if style_preset != \"None\":\n",
" params[\"style_preset\"] = style_preset\n",
"\n",
"response = send_generation_request(\n",
" host,\n",
" params\n",
Expand Down Expand Up @@ -433,14 +441,15 @@
}
],
"source": [
"#@title SD3 and SD3.5\n",
"#@title SD3.5\n",
"\n",
"prompt = \"cinematic film still, action photo of a cat riding a skateboard through the leaves in autumn. the cat has a mouse friend resting on their head\" #@param {type:\"string\"}\n",
"negative_prompt = \"\" #@param {type:\"string\"}\n",
"aspect_ratio = \"1:1\" #@param [\"21:9\", \"16:9\", \"3:2\", \"5:4\", \"1:1\", \"4:5\", \"2:3\", \"9:16\", \"9:21\"]\n",
"seed = 0 #@param {type:\"integer\"}\n",
"output_format = \"jpeg\" #@param [\"jpeg\", \"png\"]\n",
"model = \"sd3.5-large\" #@param [\"sd3.5-large\", \"sd3.5-large\", \"sd3-large-turbo\", \"sd3-medium\"]\n",
"model = \"sd3.5-large\" #@param [\"sd3.5-large\", \"sd3.5-large-turbo\", \"sd3.5-medium\"]\n",
"style_preset = \"None\" #@param [\"None\",\"3d-model\", \"analog-film\", \"anime\", \"cinematic\", \"comic-book\", \"digital-art\", \"enhance\", \"fantasy-art\", \"isometric\", \"line-art\", \"low-poly\", \"modeling-compound\", \"neon-punk\", \"origami\", \"photographic\", \"pixel-art\", \"tile-texture\"]\n",
"\n",
"host = f\"https://api.stability.ai/v2beta/stable-image/generate/sd3\"\n",
"\n",
Expand All @@ -454,6 +463,9 @@
" \"mode\" : \"text-to-image\"\n",
"}\n",
"\n",
"if style_preset != \"None\":\n",
" params[\"style_preset\"] = style_preset\n",
"\n",
"response = send_generation_request(\n",
" host,\n",
" params\n",
Expand Down