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.

Principles of Information Systems (MindTap Course List)
12th Edition
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Ralph Stair, George Reynolds
Chapter5: Database Systems And Applications
Section: Chapter Questions
Problem 20SAT
icon
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)
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Development strategies
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning