jbilcke / oot_diffusion_with_mask

Don't mind me :) this is just a fork of viktorfa/oot_diffusion_with_mask

  • Public
  • 26 runs
Iterate in playground

Input

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

npx create-replicate --model=jbilcke/oot_diffusion_with_mask
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 jbilcke/oot_diffusion_with_mask using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.

const output = await replicate.run(
  "jbilcke/oot_diffusion_with_mask:26537c045ccf18d3d135dd6d35303c2db452a3d05d02111a82d6b4cba2210259",
  {
    input: {
      seed: 0,
      steps: 20,
      model_image: "https://raw.githubusercontent.com/viktorfa/oot_diffusion/main/oot_diffusion/assets/model_1.png",
      num_samples: 1,
      person_mask: "https://raw.githubusercontent.com/viktorfa/oot_diffusion/main/oot_diffusion/assets/model_1_mask.png",
      garment_image: "https://raw.githubusercontent.com/viktorfa/oot_diffusion/main/oot_diffusion/assets/cloth_1.jpg",
      guidance_scale: 2
    }
  }
);

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