diff --git a/notebooks/236-stable-diffusion-v2/236-stable-diffusion-v2-optimum-demo.ipynb b/notebooks/236-stable-diffusion-v2/236-stable-diffusion-v2-optimum-demo.ipynb index 7a1b567b683..870dc24e788 100644 --- a/notebooks/236-stable-diffusion-v2/236-stable-diffusion-v2-optimum-demo.ipynb +++ b/notebooks/236-stable-diffusion-v2/236-stable-diffusion-v2-optimum-demo.ipynb @@ -139,7 +139,7 @@ "\n", "device = widgets.Dropdown(\n", " options=ie.available_devices + [\"AUTO\"],\n", - " value=\"AUTO\",\n", + " value=\"CPU\",\n", " description=\"Device:\",\n", " disabled=False,\n", ")\n", @@ -165,11 +165,12 @@ "source": [ "from optimum.intel.openvino import OVStableDiffusionPipeline\n", "\n", - "model_id = \"stabilityai/stable-diffusion-2-1-base\"\n", - "ov_pipe = OVStableDiffusionPipeline.from_pretrained(model_id, export=True, compile=False)\n", + "# download the pre-converted SD v2.1 model from Hugging Face Hub\n", + "name = \"helenai/stabilityai-stable-diffusion-2-1-base-ov\"\n", + "ov_pipe = OVStableDiffusionPipeline.from_pretrained(name, compile=False)\n", "ov_pipe.reshape(batch_size=1, height=512, width=512, num_images_per_prompt=1)\n", "ov_pipe.to(device.value)\n", - "ov_pipe.compile()\n" + "ov_pipe.compile()" ] }, { @@ -206,9 +207,12 @@ } ], "source": [ - "prompt = \"red car in snowy forest\"\n", - "output_ov = ov_pipe(prompt, num_inference_steps=17).images[0]\n", - "output_ov.save(\"image_ov_cpu.png\")\n", + "import gc\n", + "\n", + "# Generate an image. \n", + "prompt = \"red car in snowy forest, epic vista, beautiful landscape, 4k, 8k\"\n", + "output_ov = ov_pipe(prompt, num_inference_steps=17, output_type=\"pil\").images[0]\n", + "output_ov.save(\"image.png\")\n", "output_ov" ] },