Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
Choose task type.
Default: "Class-conditional Image Synthesis"
Choose the ImageNet label, which determines what type of object to synthesize or edit to.
Choose the size of the generated image. Output will generate 8 images.
Default: 256
set random seed
Default: 42
Provide input image for Class-conditional Image Editing. The image will be resized to image_size.
For Class-conditional Image Editing, provide the area for image editing in the format of top_left_height_width, e.g. input image 128_64_256_288. Output will show the resized image with the box highlighting the edited area and 8 edited images.
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
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: { seed: 42, category: "0) tench, Tinca tinca", task_type: "Class-conditional Image Synthesis", image_size: 256 } } ); // 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
import replicate
output = replicate.run( "google-research/maskgit:16325bd5e326690813672502341daab987a292560bf7a4fb9295e796785557b5", input={ "seed": 42, "category": "0) tench, Tinca tinca", "task_type": "Class-conditional Image Synthesis", "image_size": 256 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
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": { "seed": 42, "category": "0) tench, Tinca tinca", "task_type": "Class-conditional Image Synthesis", "image_size": 256 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
No output yet! Press "Submit" to start a prediction.
Choose a file from your machine
Hint: you can also drag files onto the input