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
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
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education