defaultClass-conditional Image Synthesis
typeenum
value typestring
optionsClass-conditional Image Synthesis, Class-conditional Image Editing
{
"category": "90) lorikeet",
"image_size": "256",
"seed": 42,
"task_type": "Class-conditional Image Synthesis"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_0qw**********************************
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 google-research/maskgit using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"google-research/maskgit:16325bd5e326690813672502341daab987a292560bf7a4fb9295e796785557b5",
{
input: {
category: "90) lorikeet",
image_size: "256",
seed: 42,
task_type: "Class-conditional Image Synthesis"
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
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_0qw**********************************
This is your API token. Keep it to yourself.
import replicate
Run google-research/maskgit using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"google-research/maskgit:16325bd5e326690813672502341daab987a292560bf7a4fb9295e796785557b5",
input={
"category": "90) lorikeet",
"image_size": "256",
"seed": 42,
"task_type": "Class-conditional Image Synthesis"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.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_0qw**********************************
This is your API token. Keep it to yourself.
Run google-research/maskgit 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": "google-research/maskgit:16325bd5e326690813672502341daab987a292560bf7a4fb9295e796785557b5",
"input": {
"category": "90) lorikeet",
"image_size": "256",
"seed": 42,
"task_type": "Class-conditional Image Synthesis"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "7alr7yc7ajeejo3vj3sfztz5ru",
"model": "google-research/maskgit",
"version": "16325bd5e326690813672502341daab987a292560bf7a4fb9295e796785557b5",
"input": {
"category": "90) lorikeet",
"image_size": "256",
"seed": 42,
"task_type": "Class-conditional Image Synthesis"
},
"logs": "",
"output": "https://replicate.delivery/mgxm/dd7b60c6-4807-476f-9ed7-6ce7297c55cb/output.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-04-13T14:11:57.817259Z",
"started_at": "2022-04-13T14:11:58.126704Z",
"completed_at": "2022-04-13T14:12:23.500589Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/7alr7yc7ajeejo3vj3sfztz5ru/cancel",
"get": "https://api.replicate.com/v1/predictions/7alr7yc7ajeejo3vj3sfztz5ru"
},
"metrics": {
"predict_time": 25.373885,
"total_time": 25.68333
}
}