From f866a11099ff73f9d6f6ea32b70ad71431a108ff Mon Sep 17 00:00:00 2001 From: Tomasz Wrona Date: Sun, 25 Feb 2024 23:32:50 +0100 Subject: [PATCH] Review fixes --- ...nt-of-text-to-image-diffusion-models.ipynb | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/docs/notebooks/evaluating-alignment-of-text-to-image-diffusion-models.ipynb b/docs/notebooks/evaluating-alignment-of-text-to-image-diffusion-models.ipynb index 7344fbe4..e5376364 100644 --- a/docs/notebooks/evaluating-alignment-of-text-to-image-diffusion-models.ipynb +++ b/docs/notebooks/evaluating-alignment-of-text-to-image-diffusion-models.ipynb @@ -98,7 +98,7 @@ { "cell_type": "markdown", "source": [ - "## Install required packages\u00b6\n", + "## Install required packages\n", "\n", "In this cookbook, we'll leverage the following Python packages:\n", "* `diffusers` for image generation pipelines,\n", @@ -232,13 +232,18 @@ { "cell_type": "code", "source": [ + "prompt = \"a black cat playing with a blue ball next to a parked white car, wide angle, photorealistic\"\n", + "negative_prompt = \"low quality, blurred, text, illustration\"\n", + "\n", + "width, height = 1024, 768\n", + "seed = 9213799\n", + "\n", "image = pipeline(\n", - " prompt=\"a black cat playing with a blue ball next to a parked white car, wide angle, photorealistic\",\n", - " negative_prompt=\"low quality, blurred, text, illustration\",\n", - " generator=torch.manual_seed(9213799),\n", - " num_inference_steps=50,\n", - " width=1024,\n", - " height=768,\n", + " prompt=prompt,\n", + " negative_prompt=negative_prompt,\n", + " generator=torch.manual_seed(seed),\n", + " width=width,\n", + " height=height,\n", ").images[0]\n", "image" ], @@ -570,10 +575,10 @@ { "cell_type": "code", "source": [ - "gt = {\"black cat\", \"blue ball\", \"white car\"}\n", - "pred = {results.names[class_id] for class_id in valid_detections.class_id}\n", + "ground_truth = {\"black cat\", \"blue ball\", \"white car\"}\n", + "prediction = {results.names[class_id] for class_id in valid_detections.class_id}\n", "\n", - "pred.issubset(gt)" + "prediction.issubset(ground_truth)" ], "metadata": { "colab": {