defaultpink bear riding a bicycle
typetext
{
"cross_replace_steps": 0.8,
"edited_prompt": "A painting of a lion eating a burger",
"original_prompt": "A painting of a squirrel eating a burger",
"prompt_edit_type": "Replacement",
"seed": 8888,
"self_replace_steps": 0.4
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_bUF**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run cjwbw/prompt-to-prompt using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"cjwbw/prompt-to-prompt:77f9e56f3c0eb7e635d0197e192980173a48f414499ed07bbc80d5807bdb6191",
{
input: {
cross_replace_steps: 0.8,
edited_prompt: "A painting of a lion eating a burger",
original_prompt: "A painting of a squirrel eating a burger",
prompt_edit_type: "Replacement",
seed: 8888,
self_replace_steps: 0.4
}
}
);
console.log(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_bUF**********************************
This is your API token. Keep it to yourself.
import replicate
Run cjwbw/prompt-to-prompt using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cjwbw/prompt-to-prompt:77f9e56f3c0eb7e635d0197e192980173a48f414499ed07bbc80d5807bdb6191",
input={
"cross_replace_steps": 0.8,
"edited_prompt": "A painting of a lion eating a burger",
"original_prompt": "A painting of a squirrel eating a burger",
"prompt_edit_type": "Replacement",
"seed": 8888,
"self_replace_steps": 0.4
}
)
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=r8_bUF**********************************
This is your API token. Keep it to yourself.
Run cjwbw/prompt-to-prompt 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": "cjwbw/prompt-to-prompt:77f9e56f3c0eb7e635d0197e192980173a48f414499ed07bbc80d5807bdb6191",
"input": {
"cross_replace_steps": 0.8,
"edited_prompt": "A painting of a lion eating a burger",
"original_prompt": "A painting of a squirrel eating a burger",
"prompt_edit_type": "Replacement",
"seed": 8888,
"self_replace_steps": 0.4
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Object output with 2 properties
{
"id": "begidccecrctzel6re4khz2px4",
"model": "cjwbw/prompt-to-prompt",
"version": "77f9e56f3c0eb7e635d0197e192980173a48f414499ed07bbc80d5807bdb6191",
"input": {
"cross_replace_steps": 0.8,
"edited_prompt": "A painting of a lion eating a burger",
"original_prompt": "A painting of a squirrel eating a burger",
"prompt_edit_type": "Replacement",
"seed": 8888,
"self_replace_steps": 0.4
},
"logs": "Using seed: 8888\n 0%| | 0/51 [00:00<?, ?it/s]\n 0%| | 0/51 [00:00<?, ?it/s]",
"output": {
"original_sd": "https://replicate.delivery/pbxt/TifLlbfgWtlJwEW7PqVR0rNXKfOcUstERBnr5bcXhQpegarfB/out_ori.png",
"with_prompt_to_prompt": "https://replicate.delivery/pbxt/eytrkNkytk1tBCf5yU8vYX9UnInSX4egAOYs76mTeegGC1WfD/out_p2p.png"
},
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-10-29T23:27:55.537351Z",
"started_at": "2022-10-29T23:30:56.70895Z",
"completed_at": "2022-10-29T23:32:31.720827Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/begidccecrctzel6re4khz2px4/cancel",
"get": "https://api.replicate.com/v1/predictions/begidccecrctzel6re4khz2px4"
},
"metrics": {
"predict_time": 95.011877,
"total_time": 276.183476
}
}
