typetext
{
"aspect_ratios_selection": "1152*896",
"cn_type1": "ImagePrompt",
"cn_type2": "ImagePrompt",
"cn_type3": "ImagePrompt",
"cn_type4": "ImagePrompt",
"guidance_scale": 4,
"image_number": 1,
"image_seed": 50403806253646856,
"inpaint_additional_prompt": "",
"negative_prompt": "",
"outpaint_distance_bottom": 0,
"outpaint_distance_left": 0,
"outpaint_distance_right": 0,
"outpaint_distance_top": 0,
"outpaint_selections": "",
"performance_selection": "Speed",
"prompt": "forest elf",
"refiner_switch": 0.5,
"sharpness": 2,
"style_selections": "Fooocus V2,Fooocus Enhance,Fooocus Sharp",
"uov_method": "Disabled",
"uov_upscale_value": 0
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_BM1**********************************
This is your API token. Keep it to yourself.
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:a7e8fa2f96b01d02584de2b3029a8452b9bf0c8fa4127a6d1cfd406edfad54fb",
{
input: {
aspect_ratios_selection: "1152*896",
cn_type1: "ImagePrompt",
cn_type2: "ImagePrompt",
cn_type3: "ImagePrompt",
cn_type4: "ImagePrompt",
guidance_scale: 4,
image_number: 1,
image_seed: 50403806253646856,
inpaint_additional_prompt: "",
negative_prompt: "",
outpaint_distance_bottom: 0,
outpaint_distance_left: 0,
outpaint_distance_right: 0,
outpaint_distance_top: 0,
outpaint_selections: "",
performance_selection: "Speed",
prompt: "forest elf",
refiner_switch: 0.5,
sharpness: 2,
style_selections: "Fooocus V2,Fooocus Enhance,Fooocus Sharp",
uov_method: "Disabled",
uov_upscale_value: 0
}
}
);
// 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=r8_BM1**********************************
This is your API token. Keep it to yourself.
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:a7e8fa2f96b01d02584de2b3029a8452b9bf0c8fa4127a6d1cfd406edfad54fb",
input={
"aspect_ratios_selection": "1152*896",
"cn_type1": "ImagePrompt",
"cn_type2": "ImagePrompt",
"cn_type3": "ImagePrompt",
"cn_type4": "ImagePrompt",
"guidance_scale": 4,
"image_number": 1,
"image_seed": 50403806253646856,
"inpaint_additional_prompt": "",
"negative_prompt": "",
"outpaint_distance_bottom": 0,
"outpaint_distance_left": 0,
"outpaint_distance_right": 0,
"outpaint_distance_top": 0,
"outpaint_selections": "",
"performance_selection": "Speed",
"prompt": "forest elf",
"refiner_switch": 0.5,
"sharpness": 2,
"style_selections": "Fooocus V2,Fooocus Enhance,Fooocus Sharp",
"uov_method": "Disabled",
"uov_upscale_value": 0
}
)
# 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=r8_BM1**********************************
This is your API token. Keep it to yourself.
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:a7e8fa2f96b01d02584de2b3029a8452b9bf0c8fa4127a6d1cfd406edfad54fb",
"input": {
"aspect_ratios_selection": "1152*896",
"cn_type1": "ImagePrompt",
"cn_type2": "ImagePrompt",
"cn_type3": "ImagePrompt",
"cn_type4": "ImagePrompt",
"guidance_scale": 4,
"image_number": 1,
"image_seed": 50403806253646856,
"inpaint_additional_prompt": "",
"negative_prompt": "",
"outpaint_distance_bottom": 0,
"outpaint_distance_left": 0,
"outpaint_distance_right": 0,
"outpaint_distance_top": 0,
"outpaint_selections": "",
"performance_selection": "Speed",
"prompt": "forest elf",
"refiner_switch": 0.5,
"sharpness": 2,
"style_selections": "Fooocus V2,Fooocus Enhance,Fooocus Sharp",
"uov_method": "Disabled",
"uov_upscale_value": 0
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "tfksyidb5dfvt26km6lhmaa57y",
"model": "konieshadow/fooocus-api",
"version": "a7e8fa2f96b01d02584de2b3029a8452b9bf0c8fa4127a6d1cfd406edfad54fb",
"input": {
"aspect_ratios_selection": "1152*896",
"cn_type1": "ImagePrompt",
"cn_type2": "ImagePrompt",
"cn_type3": "ImagePrompt",
"cn_type4": "ImagePrompt",
"guidance_scale": 4,
"image_number": 1,
"image_seed": 50403806253646856,
"inpaint_additional_prompt": "",
"negative_prompt": "",
"outpaint_distance_bottom": 0,
"outpaint_distance_left": 0,
"outpaint_distance_right": 0,
"outpaint_distance_top": 0,
"outpaint_selections": "",
"performance_selection": "Speed",
"prompt": "forest elf",
"refiner_switch": 0.5,
"sharpness": 2,
"style_selections": "Fooocus V2,Fooocus Enhance,Fooocus Sharp",
"uov_method": "Disabled",
"uov_upscale_value": 0
},
"logs": "[Predictor Predict] Params: {'prompt': 'forest elf', 'negative_prompt': '', 'style_selections': ['Fooocus V2', 'Fooocus Enhance', 'Fooocus Sharp'], 'performance_selection': 'Speed', 'aspect_ratios_selection': '1152*896', 'image_number': 1, 'image_seed': 50403806253646856, 'sharpness': 2.0, 'guidance_scale': 4.0, 'base_model_name': 'juggernautXL_version6Rundiffusion.safetensors', 'refiner_model_name': 'None', 'refiner_switch': 0.5, 'loras': [['sd_xl_offset_example-lora_1.0.safetensors', 0.1]], 'uov_input_image': None, 'uov_method': 'Disabled', 'upscale_value': 0.0, 'outpaint_selections': [], 'outpaint_distance_left': 0, 'outpaint_distance_right': 0, 'outpaint_distance_top': 0, 'outpaint_distance_bottom': 0, 'inpaint_input_image': None, 'inpaint_additional_prompt': '', 'image_prompts': [], 'advanced_params': [False, 1.5, 0.8, 0.3, 7.0, 'dpmpp_2m_sde_gpu', 'karras', False, -1, -1, -1, -1, -1, -1, False, False, False, False, 0.25, 64, 128, 'joint', False, None, None, None, None, False, False, 'v2.6', 1.0, 0.618]}\n[Task Queue] Task queue is free, start task, seq=1\n[Parameters] Adaptive CFG = 7.0\n[Parameters] Sharpness = 2.0\n[Parameters] ADM Scale = 1.5 : 0.8 : 0.3\n[Parameters] CFG = 4.0\n[Parameters] Seed = 50403806253646856\n[Parameters] Sampler = dpmpp_2m_sde_gpu - karras\n[Parameters] Steps = 30 - 15\n[Fooocus] Initializing ...\n[Fooocus] Loading models ...\nRefiner unloaded.\nRequest to load LoRAs [['sd_xl_offset_example-lora_1.0.safetensors', 0.1]] for model [/src/repositories/Fooocus/models/checkpoints/juggernautXL_version6Rundiffusion.safetensors].\nLoaded LoRA [/src/repositories/Fooocus/models/loras/sd_xl_offset_example-lora_1.0.safetensors] for UNet [/src/repositories/Fooocus/models/checkpoints/juggernautXL_version6Rundiffusion.safetensors] with 788 keys at weight 0.1.\nRequested to load SDXLClipModel\nLoading 1 new model\nunload clone 1\n[Fooocus Model Management] Moving model(s) has taken 0.65 seconds\n[Fooocus] Processing prompts ...\n[Fooocus] Preparing Fooocus text #1 ...\n[Prompt Expansion] forest elf, sharp focus, intricate, cinematic light, clear, crisp detail, highly detailed, singular background, elegant, complex, magical, coherent, magic, ambient, amazing composition, professional, stunning, beautiful, symmetry, illuminated, gorgeous, pretty, marvelous, aesthetic, color, epic, shiny, wonderful, pure, perfect, focused, incredible, fancy,, artistic\n[Fooocus] Encoding positive #1 ...\n[Fooocus] Encoding negative #1 ...\n[Parameters] Denoising Strength = 1.0\n[Parameters] Initial Latent shape: Image Space (896, 1152)\nPreparation time: 3.22 seconds\n[Sampler] refiner_swap_method = joint\n[Sampler] sigma_min = 0.0291671771556139, sigma_max = 14.614643096923828\nRequested to load SDXL\nLoading 1 new model\n[Fooocus Model Management] Moving model(s) has taken 0.78 seconds\n 0%| | 0/30 [00:00<?, ?it/s]\n 3%|▎ | 1/30 [00:00<00:15, 1.93it/s]\n 7%|▋ | 2/30 [00:00<00:09, 2.85it/s]\n 10%|█ | 3/30 [00:00<00:07, 3.38it/s]\n 13%|█▎ | 4/30 [00:01<00:07, 3.70it/s]\n 17%|█▋ | 5/30 [00:01<00:06, 3.90it/s]\n 20%|██ | 6/30 [00:01<00:05, 4.04it/s]\n 23%|██▎ | 7/30 [00:01<00:05, 4.11it/s]\n 27%|██▋ | 8/30 [00:02<00:05, 4.17it/s]\n 30%|███ | 9/30 [00:02<00:04, 4.21it/s]\n 33%|███▎ | 10/30 [00:02<00:04, 4.24it/s]\n 37%|███▋ | 11/30 [00:02<00:04, 4.26it/s]\n 40%|████ | 12/30 [00:03<00:04, 4.29it/s]\n 43%|████▎ | 13/30 [00:03<00:03, 4.30it/s]\n 47%|████▋ | 14/30 [00:03<00:03, 4.31it/s]\n 50%|█████ | 15/30 [00:03<00:03, 4.31it/s]\n 53%|█████▎ | 16/30 [00:03<00:03, 4.32it/s]\n 57%|█████▋ | 17/30 [00:04<00:03, 4.32it/s]\n 60%|██████ | 18/30 [00:04<00:02, 4.32it/s]\n 63%|██████▎ | 19/30 [00:04<00:02, 4.32it/s]\n 67%|██████▋ | 20/30 [00:04<00:02, 4.31it/s]\n 70%|███████ | 21/30 [00:05<00:02, 4.32it/s]\n 73%|███████▎ | 22/30 [00:05<00:01, 4.31it/s]\n 77%|███████▋ | 23/30 [00:05<00:01, 4.31it/s]\n 80%|████████ | 24/30 [00:05<00:01, 4.31it/s]\n 83%|████████▎ | 25/30 [00:06<00:01, 4.31it/s]\n 87%|████████▋ | 26/30 [00:06<00:00, 4.29it/s]\n 90%|█████████ | 27/30 [00:06<00:00, 4.29it/s]\n 93%|█████████▎| 28/30 [00:06<00:00, 4.30it/s]\n 97%|█████████▋| 29/30 [00:07<00:00, 4.32it/s]\n100%|██████████| 30/30 [00:07<00:00, 4.34it/s]\n100%|██████████| 30/30 [00:07<00:00, 4.15it/s]\nRequested to load AutoencoderKL\nLoading 1 new model\nImage generated with private log at: /src/repositories/Fooocus/outputs/2023-12-26/log.html\nGenerating and saving time: 8.69 seconds\n[Task Queue] Finish task, seq=1\n[Predictor Predict] Finished with 1 images",
"output": [
"https://replicate.delivery/pbxt/fJldwXLDky3LWSBqlm12yNVTGY7XB4WfwP24Sbfw6uJQPDMkA/e977f103-26f5-409a-b154-23be0fb56060.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-12-26T05:40:38.534817Z",
"started_at": "2023-12-26T05:42:51.468836Z",
"completed_at": "2023-12-26T05:43:04.900623Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/tfksyidb5dfvt26km6lhmaa57y/cancel",
"get": "https://api.replicate.com/v1/predictions/tfksyidb5dfvt26km6lhmaa57y"
},
"metrics": {
"predict_time": 13.431787,
"total_time": 146.365806
}
}