You're looking at a specific version of this model. Jump to the model overview.
twn39 /playground-v2-1024px-aesthetic:b52e6662
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";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run twn39/playground-v2-1024px-aesthetic using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"twn39/playground-v2-1024px-aesthetic:b52e666276fa44552baa4335b7069bd23e27086dd022bf811e1c11057b709fd2",
{
input: {
width: 1024,
height: 1024,
prompt: "Astronaut in black hole, cold color palette, muted colors, detailed, 8k",
scheduler: "KarrasDPM",
num_outputs: 2,
guidance_scale: 3,
negative_prompt: "drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly",
num_inference_steps: 25
}
}
);
// 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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run twn39/playground-v2-1024px-aesthetic using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"twn39/playground-v2-1024px-aesthetic:b52e666276fa44552baa4335b7069bd23e27086dd022bf811e1c11057b709fd2",
input={
"width": 1024,
"height": 1024,
"prompt": "Astronaut in black hole, cold color palette, muted colors, detailed, 8k",
"scheduler": "KarrasDPM",
"num_outputs": 2,
"guidance_scale": 3,
"negative_prompt": "drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly",
"num_inference_steps": 25
}
)
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 twn39/playground-v2-1024px-aesthetic 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": "twn39/playground-v2-1024px-aesthetic:b52e666276fa44552baa4335b7069bd23e27086dd022bf811e1c11057b709fd2",
"input": {
"width": 1024,
"height": 1024,
"prompt": "Astronaut in black hole, cold color palette, muted colors, detailed, 8k",
"scheduler": "KarrasDPM",
"num_outputs": 2,
"guidance_scale": 3,
"negative_prompt": "drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly",
"num_inference_steps": 25
}
}' \
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/twn39/playground-v2-1024px-aesthetic@sha256:b52e666276fa44552baa4335b7069bd23e27086dd022bf811e1c11057b709fd2 \
-i 'width=1024' \
-i 'height=1024' \
-i 'prompt="Astronaut in black hole, cold color palette, muted colors, detailed, 8k"' \
-i 'scheduler="KarrasDPM"' \
-i 'num_outputs=2' \
-i 'guidance_scale=3' \
-i 'negative_prompt="drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly"' \
-i 'num_inference_steps=25'
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/twn39/playground-v2-1024px-aesthetic@sha256:b52e666276fa44552baa4335b7069bd23e27086dd022bf811e1c11057b709fd2
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "width": 1024, "height": 1024, "prompt": "Astronaut in black hole, cold color palette, muted colors, detailed, 8k", "scheduler": "KarrasDPM", "num_outputs": 2, "guidance_scale": 3, "negative_prompt": "drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly", "num_inference_steps": 25 } }' \ 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.021. 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-12-08T02:22:17.899945Z",
"created_at": "2023-12-08T02:22:05.376817Z",
"data_removed": false,
"error": null,
"id": "2aqw55lbp7lrmsawkcck6ksw2e",
"input": {
"width": 1024,
"height": 1024,
"prompt": "Astronaut in black hole, cold color palette, muted colors, detailed, 8k",
"scheduler": "KarrasDPM",
"num_outputs": 2,
"guidance_scale": 3,
"negative_prompt": "drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly",
"num_inference_steps": 25
},
"logs": "0%| | 0/25 [00:00<?, ?it/s]\n 4%|▍ | 1/25 [00:00<00:09, 2.61it/s]\n 8%|▊ | 2/25 [00:00<00:06, 3.65it/s]\n 12%|█▏ | 3/25 [00:00<00:07, 3.08it/s]\n 16%|█▌ | 4/25 [00:01<00:07, 2.88it/s]\n 20%|██ | 5/25 [00:01<00:07, 2.78it/s]\n 24%|██▍ | 6/25 [00:02<00:06, 2.71it/s]\n 28%|██▊ | 7/25 [00:02<00:06, 2.68it/s]\n 32%|███▏ | 8/25 [00:02<00:06, 2.65it/s]\n 36%|███▌ | 9/25 [00:03<00:06, 2.64it/s]\n 40%|████ | 10/25 [00:03<00:05, 2.63it/s]\n 44%|████▍ | 11/25 [00:04<00:05, 2.62it/s]\n 48%|████▊ | 12/25 [00:04<00:04, 2.61it/s]\n 52%|█████▏ | 13/25 [00:04<00:04, 2.61it/s]\n 56%|█████▌ | 14/25 [00:05<00:04, 2.61it/s]\n 60%|██████ | 15/25 [00:05<00:03, 2.60it/s]\n 64%|██████▍ | 16/25 [00:05<00:03, 2.60it/s]\n 68%|██████▊ | 17/25 [00:06<00:03, 2.60it/s]\n 72%|███████▏ | 18/25 [00:06<00:02, 2.60it/s]\n 76%|███████▌ | 19/25 [00:07<00:02, 2.59it/s]\n 80%|████████ | 20/25 [00:07<00:01, 2.59it/s]\n 84%|████████▍ | 21/25 [00:07<00:01, 2.59it/s]\n 88%|████████▊ | 22/25 [00:08<00:01, 2.59it/s]\n 92%|█████████▏| 23/25 [00:08<00:00, 2.59it/s]\n 96%|█████████▌| 24/25 [00:09<00:00, 2.59it/s]\n100%|██████████| 25/25 [00:09<00:00, 2.59it/s]\n100%|██████████| 25/25 [00:09<00:00, 2.65it/s]",
"metrics": {
"predict_time": 12.485813,
"total_time": 12.523128
},
"output": [
"https://replicate.delivery/pbxt/PpHYwKfk7NxDSqbcON2rI8foCuCiAzMmV2ftIZ1LhirxeLAIB/out-0.jpg",
"https://replicate.delivery/pbxt/fhBDK6iosxQ6UqCzXXPtGBZxXaDISVtsMjoFTSTymHusfCASA/out-1.jpg"
],
"started_at": "2023-12-08T02:22:05.414132Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/2aqw55lbp7lrmsawkcck6ksw2e",
"cancel": "https://api.replicate.com/v1/predictions/2aqw55lbp7lrmsawkcck6ksw2e/cancel"
},
"version": "b52e666276fa44552baa4335b7069bd23e27086dd022bf811e1c11057b709fd2"
}
0%| | 0/25 [00:00<?, ?it/s]
4%|▍ | 1/25 [00:00<00:09, 2.61it/s]
8%|▊ | 2/25 [00:00<00:06, 3.65it/s]
12%|█▏ | 3/25 [00:00<00:07, 3.08it/s]
16%|█▌ | 4/25 [00:01<00:07, 2.88it/s]
20%|██ | 5/25 [00:01<00:07, 2.78it/s]
24%|██▍ | 6/25 [00:02<00:06, 2.71it/s]
28%|██▊ | 7/25 [00:02<00:06, 2.68it/s]
32%|███▏ | 8/25 [00:02<00:06, 2.65it/s]
36%|███▌ | 9/25 [00:03<00:06, 2.64it/s]
40%|████ | 10/25 [00:03<00:05, 2.63it/s]
44%|████▍ | 11/25 [00:04<00:05, 2.62it/s]
48%|████▊ | 12/25 [00:04<00:04, 2.61it/s]
52%|█████▏ | 13/25 [00:04<00:04, 2.61it/s]
56%|█████▌ | 14/25 [00:05<00:04, 2.61it/s]
60%|██████ | 15/25 [00:05<00:03, 2.60it/s]
64%|██████▍ | 16/25 [00:05<00:03, 2.60it/s]
68%|██████▊ | 17/25 [00:06<00:03, 2.60it/s]
72%|███████▏ | 18/25 [00:06<00:02, 2.60it/s]
76%|███████▌ | 19/25 [00:07<00:02, 2.59it/s]
80%|████████ | 20/25 [00:07<00:01, 2.59it/s]
84%|████████▍ | 21/25 [00:07<00:01, 2.59it/s]
88%|████████▊ | 22/25 [00:08<00:01, 2.59it/s]
92%|█████████▏| 23/25 [00:08<00:00, 2.59it/s]
96%|█████████▌| 24/25 [00:09<00:00, 2.59it/s]
100%|██████████| 25/25 [00:09<00:00, 2.59it/s]
100%|██████████| 25/25 [00:09<00:00, 2.65it/s]