Model API

Fooocus

Default parameters with automated optimizations and quality improvements.

Model id

Use this in every request
fooocus/inpaint

This model has other modes with their own ids: fooocus, fooocus/upscale-or-vary.

Run it

Quote the input, start the generation with the quote, then poll the job. Set RAYWAKE_API_KEY first; see Authentication.

# 1. Price the exact input (quotes are valid for up to 10 minutes)
curl -s https://api.raywake.com/v1/quotes \
  -H "Authorization: Bearer $RAYWAKE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "fooocus/inpaint",
  "input": {
    "prompt": "A red ceramic cup on a wooden table, soft morning light",
    "inpaint_image_url": "https://example.com/input.png"
  }
}'

# 2. Start the generation with the quote_id from step 1
curl -s https://api.raywake.com/v1/generate \
  -H "Authorization: Bearer $RAYWAKE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"model": "fooocus/inpaint", "quote_id": "QUOTE_ID", "input": {"prompt":"A red ceramic cup on a wooden table, soft morning light","inpaint_image_url":"https://example.com/input.png"}}'

# 3. Poll until the status is terminal
curl -s https://api.raywake.com/v1/jobs/JOB_ID \
  -H "Authorization: Bearer $RAYWAKE_API_KEY"

Input

Input fields for fooocus/inpaint
NameTypeDescription
promptstring
The prompt to use for generating the image. Be as descriptive as possible for best results.
negative_promptstring
The negative prompt to use. Use it to address details that you don't want in the image. This could be colors, objects, scenery and even the small details (e.g. moustache, blurry, low resolution).
performancestring (enum)
You can choose Speed or Quality

Default: Extreme Speed

One of: Speed, Quality, Extreme Speed, Lightning

guidance_scalenumber
The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you.

Default: 4

sharpnessnumber
The sharpness of the generated image. Use it to control how sharp the generated image should be. Higher value means image and texture are sharper.

Default: 2

aspect_ratiostring
The size of the generated image. You can choose between some presets or custom height and width that **must be multiples of 8**.

Default: 1024x1024

num_imagesinteger
Number of images to generate in one request

Default: 1

lorasarray of objects
The LoRAs to use for the image generation. You can use up to 5 LoRAs and they will be merged together to generate the final image.

Default: [{"path":"https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_offset_example-lora_1.0.safetensors","scale":0.1}]

refiner_modelstring (enum)
Refiner (SDXL or SD 1.5)

Default: None

One of: None, realisticVisionV60B1_v51VAE.safetensors

refiner_switchnumber
Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models 0.8 for XL-refiners; or any value for switching two SDXL models.

Default: 0.8

output_formatstring (enum)
The format of the generated image.

Default: jpeg

One of: png, jpeg, webp

sync_modeboolean
If `True`, the media will be returned as a data URI and the output data won't be available in the request history.

Default: false

seedinteger
The same seed and the same prompt given to the same version of Stable Diffusion will output the same image every time.
inpaint_image_urlrequiredstring (image URL)
The image to use as a reference for inpainting.
mask_image_urlstring (image URL)
The image to use as a mask for the generated image.
inpaint_modestring (enum)
The mode to use for inpainting.

Default: Inpaint or Outpaint (default)

One of: Inpaint or Outpaint (default), Improve Detail (face, hand, eyes, etc.), Modify Content (add objects, change background, etc.)

inpaint_additional_promptstring
Describe what you want to inpaint.
override_inpaint_optionsboolean
If set to true, the advanced inpaint options ('inpaint_disable_initial_latent', 'inpaint_engine', 'inpaint_strength', 'inpaint_respective_field', 'inpaint_erode_or_dilate') will be overridden. Otherwise, the default values will be used.

Default: false

inpaint_disable_initial_latentboolean
If set to true, the initial preprocessing will be disabled.

Default: false

inpaint_enginestring (enum)
Version of Fooocus inpaint model

Default: v2.6

One of: None, v1, v2.5, v2.6

inpaint_strengthnumber
Same as the denoising strength in A1111 inpaint. Only used in inpaint, not used in outpaint. (Outpaint always use 1.0)

Default: 1

inpaint_respective_fieldnumber
The area to inpaint. Value 0 is same as "Only Masked" in A1111. Value 1 is same as "Whole Image" in A1111. Only used in inpaint, not used in outpaint. (Outpaint always use 1.0)

Default: 0.618

inpaint_erode_or_dilatenumber
Positive value will make white area in the mask larger, negative value will make white area smaller. (default is 0, always process before any mask invert)

Default: 0

invert_maskboolean
If set to true, the mask will be inverted.

Default: false

image_prompt_1object
ImagePrompt
image_prompt_2object
ImagePrompt
image_prompt_3object
ImagePrompt
image_prompt_4object
ImagePrompt
mixing_image_prompt_and_inpaintboolean
Mixing Image Prompt and Inpaint

Default: false

Some fields of this model are not available through Raywake: outpaint_selections.

Output

A succeeded job lists its results under outputs, stored on our side. See Jobs for every field.

Job excerpt
"outputs": [
  { "type": "image", "url": "https://…", "mime_type": "image/png", "thumbnail_url": "https://…" }
]

Pricing

  • up to$0.60/ run

The exact charge for your input comes from a quote. How charges settle