You're looking at a specific version of this model. Jump to the model overview.
arielreplicate /instruct-pix2pix:10e63b0e
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable: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 arielreplicate/instruct-pix2pix using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"arielreplicate/instruct-pix2pix:10e63b0e6361eb23a0374f4d9ee145824d9d09f7a31dcd70803193ebc7121430",
{
input: {
seed: 0,
cfg_text: 15,
cfg_image: 1,
resolution: 512,
input_image: "https://replicate.delivery/pbxt/IBuNRwAfF300G5uRCESUsqAjXIVOVEqg2ZhFLiYcru6Kg9mm/1.webp",
instruction_text: "Give him a beard"
}
}
);
// 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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run arielreplicate/instruct-pix2pix using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"arielreplicate/instruct-pix2pix:10e63b0e6361eb23a0374f4d9ee145824d9d09f7a31dcd70803193ebc7121430",
input={
"seed": 0,
"cfg_text": 15,
"cfg_image": 1,
"resolution": 512,
"input_image": "https://replicate.delivery/pbxt/IBuNRwAfF300G5uRCESUsqAjXIVOVEqg2ZhFLiYcru6Kg9mm/1.webp",
"instruction_text": "Give him a beard"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run arielreplicate/instruct-pix2pix 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": "arielreplicate/instruct-pix2pix:10e63b0e6361eb23a0374f4d9ee145824d9d09f7a31dcd70803193ebc7121430",
"input": {
"seed": 0,
"cfg_text": 15,
"cfg_image": 1,
"resolution": 512,
"input_image": "https://replicate.delivery/pbxt/IBuNRwAfF300G5uRCESUsqAjXIVOVEqg2ZhFLiYcru6Kg9mm/1.webp",
"instruction_text": "Give him a beard"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
brew install cog
If you don’t have Homebrew, there are other installation options available.
Run this to download the model and run it in your local environment:
cog predict r8.im/arielreplicate/instruct-pix2pix@sha256:10e63b0e6361eb23a0374f4d9ee145824d9d09f7a31dcd70803193ebc7121430 \
-i 'seed=0' \
-i 'cfg_text=15' \
-i 'cfg_image=1' \
-i 'resolution=512' \
-i 'input_image="https://replicate.delivery/pbxt/IBuNRwAfF300G5uRCESUsqAjXIVOVEqg2ZhFLiYcru6Kg9mm/1.webp"' \
-i 'instruction_text="Give him a beard"'
To learn more, take a look at the Cog documentation.
Run this to download the model and run it in your local environment:
docker run -d -p 5000:5000 --gpus=all r8.im/arielreplicate/instruct-pix2pix@sha256:10e63b0e6361eb23a0374f4d9ee145824d9d09f7a31dcd70803193ebc7121430
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "seed": 0, "cfg_text": 15, "cfg_image": 1, "resolution": 512, "input_image": "https://replicate.delivery/pbxt/IBuNRwAfF300G5uRCESUsqAjXIVOVEqg2ZhFLiYcru6Kg9mm/1.webp", "instruction_text": "Give him a beard" } }' \ http://localhost:5000/predictions
To learn more, take a look at the Cog documentation.
Add a payment method to run this model.
Each run costs approximately $0.055. Alternatively, try out our featured models for free.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2023-01-24T07:18:09.806192Z",
"created_at": "2023-01-24T07:17:49.573399Z",
"data_removed": false,
"error": null,
"id": "edg57puf65edvfzah2mtyc544e",
"input": {
"seed": 0,
"cfg_text": 15,
"cfg_image": 1,
"resolution": 512,
"input_image": "https://replicate.delivery/pbxt/IBuNRwAfF300G5uRCESUsqAjXIVOVEqg2ZhFLiYcru6Kg9mm/1.webp",
"instruction_text": "Give him a beard"
},
"logs": null,
"metrics": {
"predict_time": 10.088773,
"total_time": 20.232793
},
"output": "https://replicate.delivery/pbxt/qdfdm5n4pEx9YyshUDaalGdAz04YxS4YFPkB05oepW0xgTXQA/output.jpg",
"started_at": "2023-01-24T07:17:59.717419Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/edg57puf65edvfzah2mtyc544e",
"cancel": "https://api.replicate.com/v1/predictions/edg57puf65edvfzah2mtyc544e/cancel"
},
"version": "10e63b0e6361eb23a0374f4d9ee145824d9d09f7a31dcd70803193ebc7121430"
}