> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alpacaml.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fill

> Create amazing backdrops, uncrop or extend an image

<img src="https://mintcdn.com/alpacaml/NXSO2NCVHCdG0mVD/images/classic/sunset_mountains-modified.webp?fit=max&auto=format&n=NXSO2NCVHCdG0mVD&q=85&s=27d171d3130c48975585e9ff0d88d281" alt="Hero Image" width="2208" height="960" data-path="images/classic/sunset_mountains-modified.webp" />

<b>Fill</b> allows you to seamlessly extend or alter existing images with your prompts.

Fill's use cases can be roughly broken down in two categories:

* Inpainting: Changing a portion of an existing image, such as removing or adding an object.
* Extending an image: Extending an image outward, this is also sometimes call outpainting, uncropping or "zooming out".

We will look at how to use Fill for both scenarios.

### Inpainting - Modifying an existing image

In this example we will use Fill to add new elements to an existing image. It can also be used to remove or alter existing elements.

<iframe width="560" height="315" src="https://www.youtube.com/embed/eBR14vIUvQs?si=zQy0LpbzEiV6ZP2u" title="Alpaca Quickstart | Modifying an Image" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allow="fullscreen" />

<b>Fill</b> is controlled by two inputs:{" "}

* a selection
* a text prompt

The selection, which you will define using Photoshop's rectangular `Marquee`
tool (`ctrl/⌘ + M`), indicates the region of the image you wish to modify.
The prompt allows you to guide the generation in a specific direction, you can also decide to not provide any prompt and let Alpaca
decide what to generate based on the rest of the image.

### Extending an image

It is possible to extend an image by repeating the process describe above in all directions, but that would be pretty cumbersome.
For this purpose, Alpaca has a second mode to make this process much faster.

<iframe width="560" height="315" src="https://www.youtube.com/embed/gugeoQOkx8s?si=9gxcM6a7P2fRBO_0" title="Alpaca Quickstart | Extending an Image" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allow="fullscreen" />

First, extend your document's canvas to the new desired size (keep in mind Alpaca cannot fill zones more than 2048x2048 in dimension).

<Warning>
  Make sure your document's background is transparent, as only transparent
  pixels will be filled by Alpaca in this mode!
</Warning>

<Frame caption="Extending the canvas with transparency">
  <img className="rounded-md" src="https://mintcdn.com/alpacaml/NXSO2NCVHCdG0mVD/images/classic/tools/fill/outpaint_canvas.webp?fit=max&auto=format&n=NXSO2NCVHCdG0mVD&q=85&s=c0b0b67ba12520d4925c6fe5968981b8" width="1264" height="633" data-path="images/classic/tools/fill/outpaint_canvas.webp" />
</Frame>

Next, Under `Fill Settings`, change the `Region to fill` settings to `Transparency`.

<Frame caption="">
  <img width="350" className="rounded-md" src="https://mintcdn.com/alpacaml/NXSO2NCVHCdG0mVD/images/classic/tools/fill/transparency_fill.webp?fit=max&auto=format&n=NXSO2NCVHCdG0mVD&q=85&s=36b693a420cb054307acc1874c779031" data-path="images/classic/tools/fill/transparency_fill.webp" />
</Frame>

Now, whenever you make a selection for fill, only the areas which are transparent will be modified, keeping your image unchanged.
You can now select the entire document and click on `Generate`.

## Parameters

***

<AccordionGroup>
  <Accordion title="Main Parameters">
    ### Prompt

    The `Prompt` box, located in the main section of the Alpaca panel, takes in a text prompt describing the subject matter,
    style, composition, and characteristics of your desired image. You can also describe what you <it>do not</it> want to see in the output by clickling on `Exclude`.
    You can learn more about writing prompts by checking our our [Prompt Guide](/guides/prompting).

    ### Images

    Allows you to specify how many images you want Alpaca to generate from 1 to 5. The higher the number of images, the more credits the generation will cost, and the slowest it will be.

    ### Seed

    The seed acts as a unique identifier, guiding the creation process of each generation.
    If you retain the same seed with identical settings, the output will always be the same.
    Retain the seed, while changing other parameters (e.g. altering the prompt) and you'll derive a distinct yet related creation.
    For an element of unpredictability, set the seed to `0` and Alpaca will choose a random seed for each image, creating more variations

    ### Steps

    Higher number of steps will lead to better quality, but also cost more credits and make the generation slower.
  </Accordion>

  <Accordion title="Fill Settings">
    ### Region to fill

    Controls which part of your selection will be changed in the generation.

    * `Entire Selection`: Default mode -- your entire selection will be modified to match the surrounding pixels and your prompt. Best for inpainting.
    * `Transparency`: Only the parts of your selection that are transparent will be modified. This is best for extending an image (Zooming out or Outpainting)
  </Accordion>

  <Accordion title="Advanced Settings">
    ### Prompt Strength

    The `Prompt Strength` slider controls the influence of the prompt — higher values of this parameter force the model to be more
    attentive to the prompt. We can consider this to be a “rigid” vs “relaxed” interpretation of the prompt. 7 is a good balance.
  </Accordion>
</AccordionGroup>
