Skip to content

Commit

Permalink
Expand ReplicateStableDiffusion example with denoising step
Browse files Browse the repository at this point in the history
  • Loading branch information
NivekT committed Sep 4, 2023
1 parent 1cb0618 commit 46ce1ab
Showing 1 changed file with 33 additions and 13 deletions.
46 changes: 33 additions & 13 deletions examples/notebooks/image_experiments/ReplicateStableDiffusion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"id": "ed4e635e",
"metadata": {},
"outputs": [],
Expand All @@ -65,7 +65,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"id": "beaa70a1",
"metadata": {},
"outputs": [],
Expand All @@ -91,15 +91,16 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"id": "347590cf",
"metadata": {},
"outputs": [],
"source": [
"sd1 = \"stability-ai/stable-diffusion:ac732df83cea7fff18b8472768c88ad041fa750ff7682a21affe81863cbe77e4\"\n",
"models = [sd1] # You can specify multiple models here\n",
"input_kwargs = {\"prompt\": [\"a 19th century portrait of a wombat gentleman\",\n",
" \"a 22nd century portrait of a wombat gentleman\"]}\n",
" \"a 22nd century portrait of a wombat gentleman\"],\n",
" \"num_inference_steps\": [10, 60]}\n",
"model_specific_kwargs = {sd1: {}}\n",
"\n",
"experiment = ReplicateExperiment(models, input_kwargs, model_specific_kwargs, use_image_model=True)"
Expand All @@ -115,7 +116,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"id": "ca01ff10",
"metadata": {
"scrolled": true
Expand All @@ -128,23 +129,40 @@
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>input</th>\n",
" <th>prompt</th>\n",
" <th>num_inference_steps</th>\n",
" <th>latency</th>\n",
" <th>images</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>{'prompt': 'a 19th century portrait of a wombat gentleman'}</td>\n",
" <td>4.154633</td>\n",
" <td><img src=\"https://pbxt.replicate.delivery/WkGqWEOKhlKVN5tnfn1Dk5X7GIspINVTCiXSifFODTrtQ2eiA/out-0.png\" width=\"300\"/></td>\n",
" <td>a 19th century portrait of a wombat gentleman</td>\n",
" <td>10</td>\n",
" <td>3.172597</td>\n",
" <td><img src=\"https://pbxt.replicate.delivery/LBOOojMRMXr1ERnYKXHq6XYzhLeIQe53QpLK8Z4efh1NJ1DGB/out-0.png\" width=\"300\"/></td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>{'prompt': 'a 22nd century portrait of a wombat gentleman'}</td>\n",
" <td>6.877061</td>\n",
" <td><img src=\"https://pbxt.replicate.delivery/eiqUWyZ7qp3mUKI1QEac7ZXcxSwBKN9YNGh1DElB8ZOaIbvIA/out-0.png\" width=\"300\"/></td>\n",
" <td>a 19th century portrait of a wombat gentleman</td>\n",
" <td>60</td>\n",
" <td>5.102608</td>\n",
" <td><img src=\"https://pbxt.replicate.delivery/O52kqIwSJpboApyRx3Js8nGIYa7yfW3pftOof8sd3e9fSqHMC/out-0.png\" width=\"300\"/></td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>a 22nd century portrait of a wombat gentleman</td>\n",
" <td>10</td>\n",
" <td>4.341799</td>\n",
" <td><img src=\"https://pbxt.replicate.delivery/389IZcXN5uJoN9c1Hw3Gw7SOpZ2CwKNiE0fgL3s2pZNOpegRA/out-0.png\" width=\"300\"/></td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>a 22nd century portrait of a wombat gentleman</td>\n",
" <td>60</td>\n",
" <td>4.258093</td>\n",
" <td><img src=\"https://pbxt.replicate.delivery/DivsgbvAK27zJBndRsM2q7foHjx0HErQfNSDJ26ZaLlgS9gRA/out-0.png\" width=\"300\"/></td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
Expand Down Expand Up @@ -175,7 +193,9 @@
"id": "bebb8023",
"metadata": {},
"source": [
"This will be updated with structural similarity evaluation. For now, you can reference the example in the Stable Diffusion notebook example. Please don't hesitate to open an issue if you have any suggestions. Stay tuned."
"The Stable Diffusion notebook example povides an example of structural similarity evaluation. Please reference that example if you are interested automated evaluation of images.\n",
"\n",
"Please don't hesitate to open an issue or PR if you have any other suggestions evaluation of image models!"
]
}
],
Expand Down

0 comments on commit 46ce1ab

Please sign in to comment.