aaronhayes / sam2-infill-anything

Inpaint anything with automatic mask generation

  • Public
  • 830 runs
  • A100 (80GB)
Iterate in playground

Input

image
*file

Input image

*string
Shift + Return to add a new line

Prompt to infill image

string
Shift + Return to add a new line

Negative prompt for infill image

Default: "deformed, distorted, blurry, bad light, extra buildings, extra structures, buildings, overexposed, oversaturated, fake, animated, cartoon"

*string
Shift + Return to add a new line

Prompt for SAM2 mask generation

number

Threshold for mask generation, higher values lead to more restrictive masks

Default: 0.5

integer

Interference steps

Default: 20

number

Classifier-free guidance scale balances creativity and prompt adherence. Higher values results in images matching the prompt more closely.

Default: 9.5

number

The amount of denoise applied, lower values will maintain the structure of the input image

Default: 0.85

string

Format of the output images

Default: "jpg"

integer
(minimum: 0, maximum: 100)

Quality of the output images, from 0 to 100. 100 is best quality, 0 is lowest quality.

Default: 95

integer

Set a seed for reproducibility. Random by default.

Output

output
Generated in

Run time and cost

This model costs approximately $0.13 to run on Replicate, or 7 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker.

This model runs on Nvidia A100 (80GB) GPU hardware. Predictions typically complete within 93 seconds. The predict time for this model varies significantly based on the inputs.

Readme

SAM2 Infill Anything

No manual masking required. By using SAM2 a mask is automatically created, and then we can inpaint any object you wish.