typetext
{
"num_database_results": "10",
"prompt": "Guybrush meets a friendly alien on a distant planet",
"scale": 5,
"seed": -1,
"steps": 100
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_DnB**********************************
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 andreasjansson/monkey-island-rdm using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"andreasjansson/monkey-island-rdm:2c737891c668aa2a759ea6db63b35d3a4f569a803dbad2446c872475c4fb6c63",
{
input: {
num_database_results: "10",
prompt: "Guybrush meets a friendly alien on a distant planet",
scale: 5,
seed: -1,
steps: 100
}
}
);
// 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_DnB**********************************
This is your API token. Keep it to yourself.
import replicate
Run andreasjansson/monkey-island-rdm using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"andreasjansson/monkey-island-rdm:2c737891c668aa2a759ea6db63b35d3a4f569a803dbad2446c872475c4fb6c63",
input={
"num_database_results": "10",
"prompt": "Guybrush meets a friendly alien on a distant planet",
"scale": 5,
"seed": -1,
"steps": 100
}
)
# 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_DnB**********************************
This is your API token. Keep it to yourself.
Run andreasjansson/monkey-island-rdm 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": "andreasjansson/monkey-island-rdm:2c737891c668aa2a759ea6db63b35d3a4f569a803dbad2446c872475c4fb6c63",
"input": {
"num_database_results": "10",
"prompt": "Guybrush meets a friendly alien on a distant planet",
"scale": 5,
"seed": -1,
"steps": 100
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "bh5dthdlevci5lnyjpu2zckmpm",
"model": "andreasjansson/monkey-island-rdm",
"version": "2c737891c668aa2a759ea6db63b35d3a4f569a803dbad2446c872475c4fb6c63",
"input": {
"num_database_results": "10",
"prompt": "Guybrush meets a friendly alien on a distant planet",
"scale": 5,
"seed": -1,
"steps": 100
},
"logs": "Using random seed 2022426247\nSeed: -1\nCLIP Text Embed: torch.Size([1, 1, 768])\nData shape for PLMS sampling is (1, 16, 48, 48)\nRunning PLMS Sampling with 100 timesteps\n\nPLMS Sampler: 0%| | 0/100 [00:00<?, ?it/s]\nPLMS Sampler: 1%| | 1/100 [00:00<00:16, 6.10it/s]\nPLMS Sampler: 3%|▎ | 3/100 [00:00<00:09, 10.19it/s]\nPLMS Sampler: 5%|▌ | 5/100 [00:00<00:07, 11.90it/s]\nPLMS Sampler: 7%|▋ | 7/100 [00:00<00:07, 12.74it/s]\nPLMS Sampler: 9%|▉ | 9/100 [00:00<00:06, 13.16it/s]\nPLMS Sampler: 11%|█ | 11/100 [00:00<00:06, 13.34it/s]\nPLMS Sampler: 13%|█▎ | 13/100 [00:01<00:06, 13.58it/s]\nPLMS Sampler: 15%|█▌ | 15/100 [00:01<00:06, 13.54it/s]\nPLMS Sampler: 17%|█▋ | 17/100 [00:01<00:06, 13.62it/s]\nPLMS Sampler: 19%|█▉ | 19/100 [00:01<00:05, 13.52it/s]\nPLMS Sampler: 21%|██ | 21/100 [00:01<00:05, 13.65it/s]\nPLMS Sampler: 23%|██▎ | 23/100 [00:01<00:05, 13.75it/s]\nPLMS Sampler: 25%|██▌ | 25/100 [00:01<00:05, 13.64it/s]\nPLMS Sampler: 27%|██▋ | 27/100 [00:02<00:05, 13.72it/s]\nPLMS Sampler: 29%|██▉ | 29/100 [00:02<00:05, 13.84it/s]\nPLMS Sampler: 31%|███ | 31/100 [00:02<00:04, 13.82it/s]\nPLMS Sampler: 33%|███▎ | 33/100 [00:02<00:04, 13.86it/s]\nPLMS Sampler: 35%|███▌ | 35/100 [00:02<00:04, 13.90it/s]\nPLMS Sampler: 37%|███▋ | 37/100 [00:02<00:04, 13.92it/s]\nPLMS Sampler: 39%|███▉ | 39/100 [00:02<00:04, 13.94it/s]\nPLMS Sampler: 41%|████ | 41/100 [00:03<00:04, 13.96it/s]\nPLMS Sampler: 43%|████▎ | 43/100 [00:03<00:04, 13.76it/s]\nPLMS Sampler: 45%|████▌ | 45/100 [00:03<00:03, 13.79it/s]\nPLMS Sampler: 47%|████▋ | 47/100 [00:03<00:03, 13.74it/s]\nPLMS Sampler: 49%|████▉ | 49/100 [00:03<00:03, 13.81it/s]\nPLMS Sampler: 51%|█████ | 51/100 [00:03<00:03, 13.69it/s]\nPLMS Sampler: 53%|█████▎ | 53/100 [00:03<00:03, 13.65it/s]\nPLMS Sampler: 55%|█████▌ | 55/100 [00:04<00:03, 13.75it/s]\nPLMS Sampler: 57%|█████▋ | 57/100 [00:04<00:03, 13.79it/s]\nPLMS Sampler: 59%|█████▉ | 59/100 [00:04<00:02, 13.85it/s]\nPLMS Sampler: 61%|██████ | 61/100 [00:04<00:02, 13.87it/s]\nPLMS Sampler: 63%|██████▎ | 63/100 [00:04<00:02, 13.88it/s]\nPLMS Sampler: 65%|██████▌ | 65/100 [00:04<00:02, 13.88it/s]\nPLMS Sampler: 67%|██████▋ | 67/100 [00:04<00:02, 13.89it/s]\nPLMS Sampler: 69%|██████▉ | 69/100 [00:05<00:02, 13.90it/s]\nPLMS Sampler: 71%|███████ | 71/100 [00:05<00:02, 13.94it/s]\nPLMS Sampler: 73%|███████▎ | 73/100 [00:05<00:02, 13.49it/s]\nPLMS Sampler: 75%|███████▌ | 75/100 [00:05<00:01, 13.51it/s]\nPLMS Sampler: 77%|███████▋ | 77/100 [00:05<00:01, 13.43it/s]\nPLMS Sampler: 79%|███████▉ | 79/100 [00:05<00:01, 13.57it/s]\nPLMS Sampler: 81%|████████ | 81/100 [00:05<00:01, 13.68it/s]\nPLMS Sampler: 83%|████████▎ | 83/100 [00:06<00:01, 13.75it/s]\nPLMS Sampler: 85%|████████▌ | 85/100 [00:06<00:01, 13.83it/s]\nPLMS Sampler: 87%|████████▋ | 87/100 [00:06<00:00, 13.91it/s]\nPLMS Sampler: 89%|████████▉ | 89/100 [00:06<00:00, 13.98it/s]\nPLMS Sampler: 91%|█████████ | 91/100 [00:06<00:00, 14.03it/s]\nPLMS Sampler: 93%|█████████▎| 93/100 [00:06<00:00, 13.75it/s]\nPLMS Sampler: 95%|█████████▌| 95/100 [00:06<00:00, 13.71it/s]\nPLMS Sampler: 97%|█████████▋| 97/100 [00:07<00:00, 13.77it/s]\nPLMS Sampler: 99%|█████████▉| 99/100 [00:07<00:00, 13.81it/s]\nPLMS Sampler: 100%|██████████| 100/100 [00:07<00:00, 13.62it/s]",
"output": "https://replicate.delivery/mgxm/f73c9fa0-227b-4734-91b9-e2f2f24b3bf0/out.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-08-19T16:48:38.788632Z",
"started_at": "2022-08-19T16:48:38.984706Z",
"completed_at": "2022-08-19T16:48:47.508284Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/bh5dthdlevci5lnyjpu2zckmpm/cancel",
"get": "https://api.replicate.com/v1/predictions/bh5dthdlevci5lnyjpu2zckmpm"
},
"metrics": {
"predict_time": 8.523578,
"total_time": 8.719652
}
}