typetext
{
"guidance_scale": 7.5,
"num_inference_steps": "50",
"num_outputs": 1,
"prompt": "tetsujin1979"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_aEU**********************************
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 lambdal/text-to-pokemon using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"lambdal/text-to-pokemon:3554d9e699e09693d3fa334a79c58be9a405dd021d3e11281256d53185868912",
{
input: {
guidance_scale: 7.5,
num_inference_steps: "50",
num_outputs: 1,
prompt: "tetsujin1979"
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
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_aEU**********************************
This is your API token. Keep it to yourself.
import replicate
Run lambdal/text-to-pokemon using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lambdal/text-to-pokemon:3554d9e699e09693d3fa334a79c58be9a405dd021d3e11281256d53185868912",
input={
"guidance_scale": 7.5,
"num_inference_steps": "50",
"num_outputs": 1,
"prompt": "tetsujin1979"
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].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_aEU**********************************
This is your API token. Keep it to yourself.
Run lambdal/text-to-pokemon 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": "lambdal/text-to-pokemon:3554d9e699e09693d3fa334a79c58be9a405dd021d3e11281256d53185868912",
"input": {
"guidance_scale": 7.5,
"num_inference_steps": "50",
"num_outputs": 1,
"prompt": "tetsujin1979"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "756a6lk77jbihlscuvgq2nmrue",
"model": "lambdal/text-to-pokemon",
"version": "3554d9e699e09693d3fa334a79c58be9a405dd021d3e11281256d53185868912",
"input": {
"guidance_scale": 7.5,
"num_inference_steps": "50",
"num_outputs": 1,
"prompt": "tetsujin1979"
},
"logs": "Using seed: 29976\n\n 0%| | 0/51 [00:00<?, ?it/s]\n 2%|▏ | 1/51 [00:00<00:05, 9.15it/s]\n 4%|▍ | 2/51 [00:00<00:10, 4.85it/s]\n 6%|▌ | 3/51 [00:00<00:11, 4.21it/s]\n 8%|▊ | 4/51 [00:00<00:12, 3.80it/s]\n 10%|▉ | 5/51 [00:01<00:12, 3.75it/s]\n 12%|█▏ | 6/51 [00:01<00:12, 3.71it/s]\n 14%|█▎ | 7/51 [00:01<00:11, 3.68it/s]\n 16%|█▌ | 8/51 [00:02<00:12, 3.57it/s]\n 18%|█▊ | 9/51 [00:02<00:11, 3.58it/s]\n 20%|█▉ | 10/51 [00:02<00:11, 3.61it/s]\n 22%|██▏ | 11/51 [00:02<00:11, 3.58it/s]\n 24%|██▎ | 12/51 [00:03<00:10, 3.56it/s]\n 25%|██▌ | 13/51 [00:03<00:10, 3.57it/s]\n 27%|██▋ | 14/51 [00:03<00:10, 3.57it/s]\n 29%|██▉ | 15/51 [00:04<00:10, 3.55it/s]\n 31%|███▏ | 16/51 [00:04<00:09, 3.55it/s]\n 33%|███▎ | 17/51 [00:04<00:09, 3.59it/s]\n 35%|███▌ | 18/51 [00:04<00:09, 3.58it/s]\n 37%|███▋ | 19/51 [00:05<00:08, 3.57it/s]\n 39%|███▉ | 20/51 [00:05<00:08, 3.56it/s]\n 41%|████ | 21/51 [00:05<00:08, 3.58it/s]\n 43%|████▎ | 22/51 [00:06<00:08, 3.56it/s]\n 45%|████▌ | 23/51 [00:06<00:07, 3.56it/s]\n 47%|████▋ | 24/51 [00:06<00:07, 3.56it/s]\n 49%|████▉ | 25/51 [00:06<00:07, 3.57it/s]\n 51%|█████ | 26/51 [00:07<00:07, 3.55it/s]\n 53%|█████▎ | 27/51 [00:07<00:06, 3.56it/s]\n 55%|█████▍ | 28/51 [00:07<00:06, 3.57it/s]\n 57%|█████▋ | 29/51 [00:07<00:06, 3.57it/s]\n 59%|█████▉ | 30/51 [00:08<00:05, 3.57it/s]\n 61%|██████ | 31/51 [00:08<00:05, 3.57it/s]\n 63%|██████▎ | 32/51 [00:08<00:05, 3.57it/s]\n 65%|██████▍ | 33/51 [00:09<00:05, 3.57it/s]\n 67%|██████▋ | 34/51 [00:09<00:04, 3.58it/s]\n 69%|██████▊ | 35/51 [00:09<00:04, 3.58it/s]\n 71%|███████ | 36/51 [00:09<00:04, 3.58it/s]\n 73%|███████▎ | 37/51 [00:10<00:03, 3.57it/s]\n 75%|███████▍ | 38/51 [00:10<00:03, 3.57it/s]\n 76%|███████▋ | 39/51 [00:10<00:03, 3.58it/s]\n 78%|███████▊ | 40/51 [00:11<00:03, 3.57it/s]\n 80%|████████ | 41/51 [00:11<00:02, 3.56it/s]\n 82%|████████▏ | 42/51 [00:11<00:02, 3.57it/s]\n 84%|████████▍ | 43/51 [00:11<00:02, 3.57it/s]\n 86%|████████▋ | 44/51 [00:12<00:01, 3.57it/s]\n 88%|████████▊ | 45/51 [00:12<00:01, 3.56it/s]\n 90%|█████████ | 46/51 [00:12<00:01, 3.56it/s]\n 92%|█████████▏| 47/51 [00:13<00:01, 3.58it/s]\n 94%|█████████▍| 48/51 [00:13<00:00, 3.57it/s]\n 96%|█████████▌| 49/51 [00:13<00:00, 3.58it/s]\n 98%|█████████▊| 50/51 [00:13<00:00, 3.57it/s]\n100%|██████████| 51/51 [00:14<00:00, 3.56it/s]\n100%|██████████| 51/51 [00:14<00:00, 3.61it/s]",
"output": [
"https://replicate.com/api/models/lambdal/text-to-pokemon/files/d607ec1c-7a0d-47bc-bcac-b4f3c857454b/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-09-26T15:07:53.376949Z",
"started_at": "2022-09-26T15:09:01.761483Z",
"completed_at": "2022-09-26T15:09:17.207073Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/756a6lk77jbihlscuvgq2nmrue/cancel",
"get": "https://api.replicate.com/v1/predictions/756a6lk77jbihlscuvgq2nmrue"
},
"metrics": {
"predict_time": 15.44559,
"total_time": 83.830124
}
}