• Public
  • 57 runs
  • T4
Iterate in playground

Input

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

npx create-replicate --model=underthestar2021/test
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";

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

Run underthestar2021/test using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.

const output = await replicate.run(
  "underthestar2021/test:12c5a78a10253c14a6834596472602b11054e0a6c81aefe6305a508736e27698",
  {
    input: {
      prompt: "a photo of an astronaut riding a horse on mars",
      clip_skip: 2,
      pipe_type: "txt2img",
      scheduler: "DPM++ SDE Karras",
      lora_model: "empty",
      num_outputs: 1,
      resize_mode: "fill",
      target_width: 512,
      target_height: 700,
      callback_steps: 4,
      guidance_scale: 7.5,
      prompt_strength: 0.7,
      show_system_info: false,
      swap_face_enable: true,
      controlnet_enable: true,
      face_editor_enable: false,
      canny_low_threshold: 100,
      codeformer_fidelity: 0.7,
      num_inference_steps: 26,
      restore_face_enable: true,
      canny_high_threshold: 200,
      control_guidance_end: 1,
      firebase_api_version: 4,
      restore_face_upscale: 1,
      cross_attention_scale: 0.8,
      face_editor_mask_blur: 12,
      face_editor_mask_size: 6,
      face_editor_strength1: 0.4,
      face_editor_strength2: 0.05,
      restore_face_upsample: true,
      control_guidance_start: 0,
      face_editor_confidence: 0.97,
      controlnet_conditioning_scale: 1,
      restore_face_background_enhance: true
    }
  }
);

// 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 runs on Nvidia T4 GPU hardware. We don't yet have enough runs of this model to provide performance information.

Readme

This model doesn't have a readme.