jareddr / fooocus-api

  • Public
  • 54K runs
Iterate in playground

Input

Run this model in Node.js with one line of code:

npx create-replicate --model=jareddr/fooocus-api
or set up a project from scratch
npm 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 and set up the client:
import Replicate from "replicate";
import fs from "node:fs";

const replicate = new Replicate({
  auth: process.env.REPLICATE_API_TOKEN,
});

Run jareddr/fooocus-api using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.

const output = await replicate.run(
  "jareddr/fooocus-api:71bdba1f490f2294854d194d8d234480176619d67ab9c498206f7a70ca017e48",
  {
    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: 3,
      inpaint_method: "Balanced",
      refiner_switch: 0.5,
      negative_prompt: "unrealistic, saturated, high contrast, big nose, painting, drawing, sketch, cartoon, anime, manga, render, CG, 3d, watermark, signature, label",
      style_selections: "Fooocus V2,Fooocus Photograph,Fooocus Negative",
      uov_upscale_value: 0,
      outpaint_selections: "",
      outpaint_distance_top: 0,
      performance_selection: "Speed",
      outpaint_distance_left: 0,
      aspect_ratios_selection: "1344*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.

Output

No output yet! Press "Submit" to start a prediction.

Run time and cost

This model costs approximately $0.014 to run on Replicate, or 71 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 15 seconds.

Readme

This model doesn't have a readme.