You're looking at a specific version of this model. Jump to the model overview.
konieshadow /fooocus-api:fda92724
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run konieshadow/fooocus-api using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"konieshadow/fooocus-api:fda927242b1db6affa1ece4f54c37f19b964666bf23b0d06ae2439067cd344a4",
{
input: {
prompt: "",
cn_type1: "ImagePrompt",
cn_type2: "ImagePrompt",
cn_type3: "ImagePrompt",
cn_type4: "ImagePrompt",
sharpness: 2,
image_seed: -1,
uov_method: "Disabled",
image_number: 1,
guidance_scale: 4,
refiner_switch: 0.5,
negative_prompt: "",
style_selections: "Fooocus V2,Fooocus Enhance,Fooocus Sharp",
uov_upscale_value: 0,
outpaint_selections: "",
outpaint_distance_top: 0,
performance_selection: "Speed",
outpaint_distance_left: 0,
aspect_ratios_selection: "1152*896",
outpaint_distance_right: 0,
outpaint_distance_bottom: 0,
inpaint_additional_prompt: ""
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run konieshadow/fooocus-api using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"konieshadow/fooocus-api:fda927242b1db6affa1ece4f54c37f19b964666bf23b0d06ae2439067cd344a4",
input={
"prompt": "",
"cn_type1": "ImagePrompt",
"cn_type2": "ImagePrompt",
"cn_type3": "ImagePrompt",
"cn_type4": "ImagePrompt",
"sharpness": 2,
"image_seed": -1,
"uov_method": "Disabled",
"image_number": 1,
"guidance_scale": 4,
"refiner_switch": 0.5,
"negative_prompt": "",
"style_selections": "Fooocus V2,Fooocus Enhance,Fooocus Sharp",
"uov_upscale_value": 0,
"outpaint_selections": "",
"outpaint_distance_top": 0,
"performance_selection": "Speed",
"outpaint_distance_left": 0,
"aspect_ratios_selection": "1152*896",
"outpaint_distance_right": 0,
"outpaint_distance_bottom": 0,
"inpaint_additional_prompt": ""
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run konieshadow/fooocus-api using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "konieshadow/fooocus-api:fda927242b1db6affa1ece4f54c37f19b964666bf23b0d06ae2439067cd344a4",
"input": {
"prompt": "",
"cn_type1": "ImagePrompt",
"cn_type2": "ImagePrompt",
"cn_type3": "ImagePrompt",
"cn_type4": "ImagePrompt",
"sharpness": 2,
"image_seed": -1,
"uov_method": "Disabled",
"image_number": 1,
"guidance_scale": 4,
"refiner_switch": 0.5,
"negative_prompt": "",
"style_selections": "Fooocus V2,Fooocus Enhance,Fooocus Sharp",
"uov_upscale_value": 0,
"outpaint_selections": "",
"outpaint_distance_top": 0,
"performance_selection": "Speed",
"outpaint_distance_left": 0,
"aspect_ratios_selection": "1152*896",
"outpaint_distance_right": 0,
"outpaint_distance_bottom": 0,
"inpaint_additional_prompt": ""
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
brew install cog
If you don’t have Homebrew, there are other installation options available.
Run this to download the model and run it in your local environment:
cog predict r8.im/konieshadow/fooocus-api@sha256:fda927242b1db6affa1ece4f54c37f19b964666bf23b0d06ae2439067cd344a4 \
-i 'prompt=""' \
-i 'cn_type1="ImagePrompt"' \
-i 'cn_type2="ImagePrompt"' \
-i 'cn_type3="ImagePrompt"' \
-i 'cn_type4="ImagePrompt"' \
-i 'sharpness=2' \
-i 'image_seed=-1' \
-i 'uov_method="Disabled"' \
-i 'image_number=1' \
-i 'guidance_scale=4' \
-i 'refiner_switch=0.5' \
-i 'negative_prompt=""' \
-i 'style_selections="Fooocus V2,Fooocus Enhance,Fooocus Sharp"' \
-i 'uov_upscale_value=0' \
-i 'outpaint_selections=""' \
-i 'outpaint_distance_top=0' \
-i 'performance_selection="Speed"' \
-i 'outpaint_distance_left=0' \
-i 'aspect_ratios_selection="1152*896"' \
-i 'outpaint_distance_right=0' \
-i 'outpaint_distance_bottom=0' \
-i 'inpaint_additional_prompt=""'
To learn more, take a look at the Cog documentation.
Run this to download the model and run it in your local environment:
docker run -d -p 5000:5000 --gpus=all r8.im/konieshadow/fooocus-api@sha256:fda927242b1db6affa1ece4f54c37f19b964666bf23b0d06ae2439067cd344a4
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "prompt": "", "cn_type1": "ImagePrompt", "cn_type2": "ImagePrompt", "cn_type3": "ImagePrompt", "cn_type4": "ImagePrompt", "sharpness": 2, "image_seed": -1, "uov_method": "Disabled", "image_number": 1, "guidance_scale": 4, "refiner_switch": 0.5, "negative_prompt": "", "style_selections": "Fooocus V2,Fooocus Enhance,Fooocus Sharp", "uov_upscale_value": 0, "outpaint_selections": "", "outpaint_distance_top": 0, "performance_selection": "Speed", "outpaint_distance_left": 0, "aspect_ratios_selection": "1152*896", "outpaint_distance_right": 0, "outpaint_distance_bottom": 0, "inpaint_additional_prompt": "" } }' \ http://localhost:5000/predictions
To learn more, take a look at the Cog documentation.
Add a payment method to run this model.
Each run costs approximately $0.021. Alternatively, try out our featured models for free.
By signing in, you agree to our
terms of service and privacy policy
Output
No output yet! Press "Submit" to start a prediction.