

# Amazon Nova Canvas prompting best practices
<a name="prompting-image-generation"></a>

Prompting for image generation models differs from prompting for large language models (LLMs). Image generation models do not have the ability to reason or interpret explicit commands. Therefore, it's best to phrase your prompt as if it were an image caption rather than a command or conversation. You might want to include details about the subject, action, environment, lighting, style, and camera position.

When writing an image generation prompt, be mindful of the following requirements and best practices:
+ Prompts must be no longer than 1024 characters. For very long prompts, place the least important details of your prompt near the end.
+ Do not use negation words like *"no"*, *"not"*, *"without"*, and so on in your prompt. The model doesn't understand negation in a prompt and attempting to use negation will result in the opposite of what you intend. For example, a prompt such as *"a fruit basket with no bananas"* will actually signal the model to include bananas. Instead, you can use a negative prompt, via the `negativeText` parameter, to specify any objects or characteristics that you want to exclude from the image. For example *"bananas"*.
+ As with prompts, omit negation words from your negative prompts.
+ When the output you get from a prompt is close to what you want but not quite perfect, try the following techniques one at a time in turn to refine your result:
  + Using a consistent `seed` value, make small changes to your prompt or negative prompt and re-run the prompt. This allows you to better understand how your prompt wording affects the output, allowing you to iteratively improve your results in a controlled way.
  + Once the prompt has been refined to your liking, generate more variations using the same prompt but a different `seed` value. It is often useful to generate multiple variations of an image by running the sample prompt with different seeds in order to find that perfect output image.

An effective prompt often includes short descriptions of...

1. the subject

1. the environment

1. (optional) the position or pose of the subject

1. (optional) lighting description

1. (optional) camera position/framing

1. (optional) the visual style or medium ("photo", "illustration", "painting", and so on)

## Example 1: Stock photo
<a name="generate-collapsable1"></a>

**Prompt:** realistic editorial photo of female teacher standing at a blackboard with a warm smile

**Negative Prompt:** crossed arms

![\[editorial photo of female teacher standing at a blackboard with a warm smile\]](http://docs.aws.amazon.com/nova/latest/userguide/images/example1.png)


## Example 2: Story illustration
<a name="generate-collapsable2"></a>

**Prompt:** whimsical and ethereal soft-shaded story illustration: A woman in a large hat stands at the ship's railing looking out across the ocean

**Negative Prompt:** clouds, waves

![\[whimsical and ethereal soft-shaded story illustration: A woman in a large hat stands at the ship's railing looking out across the ocean\]](http://docs.aws.amazon.com/nova/latest/userguide/images/simple-image-output-1.png)


## Example 3: Pre-visualization for TV and film production
<a name="generate-collapsable3"></a>

**Prompt:** drone view of a dark river winding through a stark Iceland landscape, cinematic quality

![\[drone view of a dark river winding through a stark Iceland landscape, cinematic quality\]](http://docs.aws.amazon.com/nova/latest/userguide/images/previs.png)


## Example 4: Fashion or editorial content
<a name="generate-collapsable4"></a>

**Prompt:** A cool looking stylish man in an orange jacket, dark skin, wearing reflective glasses. Shot from slightly low angle, face and chest in view, aqua blue sleek building shapes in background.

![\[A cool looking stylish man in an orange jacket, dark skin, wearing reflective glasses. Shot from slightly low angle, face and chest in view, aqua blue sleek building shapes in background.\]](http://docs.aws.amazon.com/nova/latest/userguide/images/output.png)


**Topics**
+ [Negative prompts](prompting-image-negative.md)
+ [Mask prompts](prompting-image-masks.md)
+ [Inpainting prompts](prompting-image-inpainting.md)
+ [Outpainting prompts](prompting-image-outpainting.md)

# Negative prompts
<a name="prompting-image-negative"></a>

Negative prompts, represented by the `negativeText` parameter, can be surprisingly useful. Use negative prompts to exclude objects or style characteristics that might otherwise naturally occur as a result of your main prompt. Here is an example.

**Prompt:** *"whimsical and ethereal soft-shaded story illustration: A woman in a large hat stands at the ship's railing looking out across the ocean"*

**Without a negative prompt**

![\[whimsical and ethereal soft-shaded story illustration: A woman in a large hat stands at the ship's railing looking out across the ocean\]](http://docs.aws.amazon.com/nova/latest/userguide/images/image_1.png)


**With the negative prompt** "waves, clouds"

![\[Previous image with the negative prompt "waves, clouds"\]](http://docs.aws.amazon.com/nova/latest/userguide/images/image_1(1).png)


# Mask prompts
<a name="prompting-image-masks"></a>

Mask prompts are used in editing operations. A mask prompt allows you to use natural language to describe the elements within an image that you want to change (in the case of inpainting) or to remain untouched (in the case of outpainting). You pass a mask prompt as part of your request using the `maskPrompt` parameter. Below are some examples that visualize the result of a mask prompt. The masked area is colored in dark blue.

**Mask Prompt: "dog"**

![\[A dog\]](http://docs.aws.amazon.com/nova/latest/userguide/images/Screenshot1.png)


**maskPrompt: "dog"**

![\[A dog\]](http://docs.aws.amazon.com/nova/latest/userguide/images/Screenshot3.png)


**Mask Prompt: "dog in a bucket"**

![\[A dog in a bucket\]](http://docs.aws.amazon.com/nova/latest/userguide/images/Screenshot2.png)


**maskPrompt: "black dog"**

![\[A black dog\]](http://docs.aws.amazon.com/nova/latest/userguide/images/Screenshot4.png)


# Inpainting prompts
<a name="prompting-image-inpainting"></a>

Inpainting is an editing operation that can be used to add, remove, or replace elements within an image. Inpainting requires an input image and either a natural language mask prompt (`maskPrompt`) or a user-provided mask image (`maskImage`) to define which parts of an image to change.

## Example 1: Removing elements from an image
<a name="generate-collapsable5"></a>

To remove an element from an image, provide a mask that fully encompasses the thing you want to remove, and omit the `text` parameter from your request. This signals to the model to remove that element.

**Input Image**

![\[Three pots\]](http://docs.aws.amazon.com/nova/latest/userguide/images/three_pots.jpg)


**Mask Prompt**

"flowers in pots"

**Result**

![\[Scene with no pots\]](http://docs.aws.amazon.com/nova/latest/userguide/images/remove-with-prompt.png)


## Example 2: Adding elements to an image
<a name="generate-collapsable6"></a>

To add an element to an image, use a mask that defines the bounds of the area where you want the element to be added and a text prompt that describes what you want the *whole* image to look like after the edit. It is usually more effective to use a mask image for this, but you may use a mask prompt instead.

The following example uses a `text` value of *"a garden gnome under a table in a greenhouse".*

**Input Image**

![\[Three pots\]](http://docs.aws.amazon.com/nova/latest/userguide/images/three_pots.jpg)


**Mask Image**

![\[Mask image\]](http://docs.aws.amazon.com/nova/latest/userguide/images/three_pots-add_mask_INVERTED.png)


**Result**

![\[New element added to the mask location\]](http://docs.aws.amazon.com/nova/latest/userguide/images/add-with-mask-image-1.png)


## Example 3: Replacing elements in an image
<a name="generate-collapsable7"></a>

You can replace one element with a new one using inpainting. A common way to achieve this is to use a mask prompt that describes the thing you want to replace. When using this approach, the outline of the new content will closely match the outline of the element which it is replacing. If this is not what you desire, create a mask image that fully encompasses the element you want to replace but doesn't adhere directly to its contours.

The following example uses a `text` value of *"a palm tree graphic"* and a `negativeText` value of *"colorful"*.

**Input Image**

![\[Reference image\]](http://docs.aws.amazon.com/nova/latest/userguide/images/ref-img-seed-1.png)


**Mask Prompt**

*"dog"*

**Result**

![\[Inpainted image\]](http://docs.aws.amazon.com/nova/latest/userguide/images/ref-inpainted-1.png)


# Outpainting prompts
<a name="prompting-image-outpainting"></a>

Outpainting is used to replace the background of an image. For best results, outpainting prompts should describe what you would like the *whole* image to look like, including the parts of the image that will not be changed.

The following example uses a `text` value of *"a coffee maker in a sparse stylish kitchen, a single plate of pastries next to the coffee maker, a single cup of coffee".*

**Input Image**

![\[Amazon coffee maker\]](http://docs.aws.amazon.com/nova/latest/userguide/images/amazon-coffee-maker-1.png)


**Mask Prompt**: *"coffee maker"*

**Result**

![\[Background replacement image\]](http://docs.aws.amazon.com/nova/latest/userguide/images/background-replacement-mask-prompt-example-1.png)


Here is another example that uses a `text` value of *"detailed photo of a flower pot sitting on an outdoor potting bench".*

**Input Image**

![\[Three pots\]](http://docs.aws.amazon.com/nova/latest/userguide/images/three_pots.jpg)


**Mask Image**

![\[mask image\]](http://docs.aws.amazon.com/nova/latest/userguide/images/three_pots-remove_mask_INVERTED.png)


**Result**

![\[Mask item moved to a new background\]](http://docs.aws.amazon.com/nova/latest/userguide/images/potted.png)
