konieshadow / fooocus-api

Third party Fooocus replicate model

  • Public
  • 1.4M runs
  • L40S
  • GitHub
  • License

Input

pip install replicate
Set the REPLICATE_API_TOKEN environment variable:
export REPLICATE_API_TOKEN=<paste-your-token-here>

Find your API token in your account settings.

Import the client:
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": "forest elf",
        "cn_type1": "ImagePrompt",
        "cn_type2": "ImagePrompt",
        "cn_type3": "ImagePrompt",
        "cn_type4": "ImagePrompt",
        "sharpness": 2,
        "image_seed": 50403806253646856,
        "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": ""
    }
)
print(output)

To learn more, take a look at the guide on getting started with Python.

Output

output
Generated in

This output was created using a different version of the model, konieshadow/fooocus-api:a7e8fa2f.

Run time and cost

This model costs approximately $0.038 to run on Replicate, or 26 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 L40S GPU hardware. Predictions typically complete within 40 seconds. The predict time for this model varies significantly based on the inputs.

Readme

Fooocus is an image generating software (based on Gradio).

Fooocus is a rethinking of Stable Diffusion and Midjourney’s designs:

  • Learned from Stable Diffusion, the software is offline, open source, and free.

  • Learned from Midjourney, the manual tweaking is not needed, and users only need to focus on the prompts and images.

The Fooocus-API project export normal http apis from it.

And this model is base on Fooocus-API. It supports almost all generation methods in Fooocus gradio interface, generate same image with same parameters. Includes:

  • Text to Image
  • Image Upscale or Variation
  • Image Inpaint or Outpaint
  • Image Prompt

Loaded Fooocus version: 2.1.860