In Task 4, what can you do with the "negative prompt"? Select one: a. It tells the model that you disliked what it generated previously. b. It inverts the colours of the resulting image. c. It tells the model what you do not want it to generate.
In Task 4, what can you do with the "negative prompt"? Select one: a. It tells the model that you disliked what it generated previously. b. It inverts the colours of the resulting image. c. It tells the model what you do not want it to generate.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
In Task 4, what can you do with the "negative prompt"?
Select one:
a.
It tells the model that you disliked what it generated previously.
b.
It inverts the colours of the resulting image.
c.
It tells the model what you do not want it to generate.
![Task 4: Add a negative prompt as input
Stable Diffusion can use negative prompts to instruct the model of what it should not include in the generated images.
In this task, we provide a text prompt to the model to instruct what type of images we want as well as a negative prompt where we tell the model what we want it
to avoid generating. We have provided four different negative prompts to try out.
Feel free to change the prompt and negative_prompts . Place the negative prompts within quotation marks "...". Adding several words separated by commas
"bad quality, cartoon" may help the model to recognize the given negative text prompt better.
In [ ]: #Prompt to input to the model, edit below
#Negative prompts for instructing the model what it should not include in the generated images
negative_prompts =
["",
"in the style of <wrong>",
"red",
"red, in the style of <wrong>”]
prompt =
"a painting of a vase with roses on a table next with an open book, oil on canvas, fine art, artistic style”
Run the cell below to start generating images with the different negative prompts.
In [] images
for negative_prompt in negative_prompts:
# Generate image from the prompt and the negative prompt
image = generate_image_from_text_prompt (pipe,
images. append (image)
prompt prompt,
negative_prompt=negative_prompt,
num_inference_steps=num_inference_steps,
seed=seed)
Plot the generated images to inspect what how they differ given the different negative prompts by running the cell below.
In [ ]: plot_images_with_negative_prompts (images, prompt, negative_prompts, rows=2, cols=2)](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F61ea897e-d5ca-4ed8-a188-9b1557795693%2F4bdca5f1-0e88-4de1-b300-372406ac8123%2F9ekcpy_processed.png&w=3840&q=75)
Transcribed Image Text:Task 4: Add a negative prompt as input
Stable Diffusion can use negative prompts to instruct the model of what it should not include in the generated images.
In this task, we provide a text prompt to the model to instruct what type of images we want as well as a negative prompt where we tell the model what we want it
to avoid generating. We have provided four different negative prompts to try out.
Feel free to change the prompt and negative_prompts . Place the negative prompts within quotation marks "...". Adding several words separated by commas
"bad quality, cartoon" may help the model to recognize the given negative text prompt better.
In [ ]: #Prompt to input to the model, edit below
#Negative prompts for instructing the model what it should not include in the generated images
negative_prompts =
["",
"in the style of <wrong>",
"red",
"red, in the style of <wrong>”]
prompt =
"a painting of a vase with roses on a table next with an open book, oil on canvas, fine art, artistic style”
Run the cell below to start generating images with the different negative prompts.
In [] images
for negative_prompt in negative_prompts:
# Generate image from the prompt and the negative prompt
image = generate_image_from_text_prompt (pipe,
images. append (image)
prompt prompt,
negative_prompt=negative_prompt,
num_inference_steps=num_inference_steps,
seed=seed)
Plot the generated images to inspect what how they differ given the different negative prompts by running the cell below.
In [ ]: plot_images_with_negative_prompts (images, prompt, negative_prompts, rows=2, cols=2)
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education