typetext
{
"guidance_scale": 7.5,
"num_inference_steps": "301",
"num_outputs": "1",
"prompt": "phase shift into an era of human+AI art collab"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_F8f**********************************
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 stability-ai/stable-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"stability-ai/stable-diffusion:714ee02be40e197b6d107bcf1fa0533e876ccc727122e7dc15a62a428dcda125",
{
input: {
guidance_scale: 7.5,
num_inference_steps: "301",
num_outputs: "1",
prompt: "phase shift into an era of human+AI art collab"
}
}
);
// 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_F8f**********************************
This is your API token. Keep it to yourself.
import replicate
Run stability-ai/stable-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"stability-ai/stable-diffusion:714ee02be40e197b6d107bcf1fa0533e876ccc727122e7dc15a62a428dcda125",
input={
"guidance_scale": 7.5,
"num_inference_steps": "301",
"num_outputs": "1",
"prompt": "phase shift into an era of human+AI art collab"
}
)
# 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_F8f**********************************
This is your API token. Keep it to yourself.
Run stability-ai/stable-diffusion 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": "stability-ai/stable-diffusion:714ee02be40e197b6d107bcf1fa0533e876ccc727122e7dc15a62a428dcda125",
"input": {
"guidance_scale": 7.5,
"num_inference_steps": "301",
"num_outputs": "1",
"prompt": "phase shift into an era of human+AI art collab"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "rjcl54wakbbrfcajzllmidreya",
"model": "stability-ai/stable-diffusion",
"version": "714ee02be40e197b6d107bcf1fa0533e876ccc727122e7dc15a62a428dcda125",
"input": {
"guidance_scale": 7.5,
"num_inference_steps": "301",
"num_outputs": "1",
"prompt": "phase shift into an era of human+AI art collab"
},
"logs": "Using seed: 48356\r\n\r\n0it [00:00, ?it/s]\r\n2it [00:00, 9.30it/s]\r\n3it [00:00, 8.75it/s]\r\n4it [00:00, 9.08it/s]\r\n5it [00:00, 8.94it/s]\r\n6it [00:00, 8.71it/s]\r\n8it [00:00, 9.05it/s]\r\n9it [00:00, 9.06it/s]\r\n11it [00:01, 9.47it/s]\r\n12it [00:01, 9.07it/s]\r\n14it [00:01, 9.23it/s]\r\n15it [00:01, 9.13it/s]\r\n16it [00:01, 8.91it/s]\r\n18it [00:01, 9.37it/s]\r\n19it [00:02, 9.02it/s]\r\n20it [00:02, 9.01it/s]\r\n21it [00:02, 9.23it/s]\r\n22it [00:02, 8.90it/s]\r\n24it [00:02, 9.47it/s]\r\n25it [00:02, 9.42it/s]\r\n26it [00:02, 9.30it/s]\r\n27it [00:02, 9.07it/s]\r\n28it [00:03, 9.25it/s]\r\n29it [00:03, 9.30it/s]\r\n30it [00:03, 9.05it/s]\r\n31it [00:03, 9.10it/s]\r\n32it [00:03, 9.06it/s]\r\n33it [00:03, 9.31it/s]\r\n34it [00:03, 9.34it/s]\r\n35it [00:03, 9.25it/s]\r\n36it [00:03, 9.09it/s]\r\n37it [00:04, 9.16it/s]\r\n38it [00:04, 9.39it/s]\r\n39it [00:04, 9.09it/s]\r\n40it [00:04, 8.47it/s]\r\n42it [00:04, 8.98it/s]\r\n44it [00:04, 9.19it/s]\r\n45it [00:04, 9.31it/s]\r\n46it [00:05, 8.86it/s]\r\n47it [00:05, 9.04it/s]\r\n48it [00:05, 9.13it/s]\r\n49it [00:05, 8.96it/s]\r\n51it [00:05, 9.37it/s]\r\n52it [00:05, 9.38it/s]\r\n53it [00:05, 9.42it/s]\r\n54it [00:05, 9.42it/s]\r\n55it [00:06, 9.05it/s]\r\n56it [00:06, 9.01it/s]\r\n57it [00:06, 9.14it/s]\r\n58it [00:06, 9.14it/s]\r\n60it [00:06, 9.23it/s]\r\n62it [00:06, 9.23it/s]\r\n63it [00:06, 9.28it/s]\r\n65it [00:07, 9.36it/s]\r\n66it [00:07, 8.99it/s]\r\n68it [00:07, 9.22it/s]\r\n69it [00:07, 9.11it/s]\r\n70it [00:07, 9.27it/s]\r\n71it [00:07, 9.36it/s]\r\n72it [00:07, 9.13it/s]\r\n74it [00:08, 9.22it/s]\r\n75it [00:08, 9.12it/s]\r\n77it [00:08, 9.38it/s]\r\n78it [00:08, 8.97it/s]\r\n79it [00:08, 9.14it/s]\r\n81it [00:08, 9.24it/s]\r\n82it [00:08, 9.26it/s]\r\n83it [00:09, 9.21it/s]\r\n84it [00:09, 8.90it/s]\r\n85it [00:09, 9.16it/s]\r\n87it [00:09, 9.47it/s]\r\n88it [00:09, 9.24it/s]\r\n89it [00:09, 9.16it/s]\r\n91it [00:09, 9.20it/s]\r\n92it [00:10, 8.66it/s]\r\n94it [00:10, 9.38it/s]\r\n95it [00:10, 9.33it/s]\r\n96it [00:10, 9.14it/s]\r\n97it [00:10, 8.78it/s]\r\n98it [00:10, 8.86it/s]\r\n99it [00:10, 8.95it/s]\r\n100it [00:10, 9.15it/s]\r\n102it [00:11, 9.40it/s]\r\n103it [00:11, 8.88it/s]\r\n104it [00:11, 8.90it/s]\r\n105it [00:11, 9.09it/s]\r\n106it [00:11, 9.32it/s]\r\n107it [00:11, 9.33it/s]\r\n108it [00:11, 8.95it/s]\r\n110it [00:12, 8.96it/s]\r\n112it [00:12, 9.30it/s]\r\n113it [00:12, 9.25it/s]\r\n114it [00:12, 9.19it/s]\r\n115it [00:12, 9.17it/s]\r\n117it [00:12, 9.01it/s]\r\n119it [00:12, 9.34it/s]\r\n120it [00:13, 9.23it/s]\r\n121it [00:13, 9.31it/s]\r\n122it [00:13, 9.16it/s]\r\n123it [00:13, 8.96it/s]\r\n124it [00:13, 9.14it/s]\r\n126it [00:13, 9.35it/s]\r\n128it [00:13, 9.47it/s]\r\n129it [00:14, 9.06it/s]\r\n130it [00:14, 9.22it/s]\r\n131it [00:14, 9.27it/s]\r\n132it [00:14, 9.15it/s]\r\n133it [00:14, 9.29it/s]\r\n134it [00:14, 9.26it/s]\r\n135it [00:14, 9.20it/s]\r\n137it [00:14, 9.34it/s]\r\n138it [00:15, 9.29it/s]\r\n140it [00:15, 9.31it/s]\r\n141it [00:15, 9.08it/s]\r\n142it [00:15, 9.19it/s]\r\n143it [00:15, 9.18it/s]\r\n145it [00:15, 9.34it/s]\r\n146it [00:15, 9.37it/s]\r\n147it [00:16, 9.26it/s]\r\n148it [00:16, 9.34it/s]\r\n150it [00:16, 9.20it/s]\r\n152it [00:16, 9.35it/s]\r\n154it [00:16, 9.44it/s]\r\n155it [00:16, 9.18it/s]\r\n156it [00:16, 9.34it/s]\r\n157it [00:17, 9.17it/s]\r\n158it [00:17, 9.37it/s]\r\n159it [00:17, 8.99it/s]\r\n160it [00:17, 9.22it/s]\r\n161it [00:17, 9.34it/s]\r\n162it [00:17, 9.12it/s]\r\n163it [00:17, 9.07it/s]\r\n164it [00:17, 9.16it/s]\r\n165it [00:17, 9.13it/s]\r\n167it [00:18, 9.23it/s]\r\n168it [00:18, 9.31it/s]\r\n169it [00:18, 9.16it/s]\r\n171it [00:18, 9.38it/s]\r\n172it [00:18, 9.16it/s]\r\n174it [00:18, 9.16it/s]\r\n175it [00:19, 9.17it/s]\r\n177it [00:19, 9.21it/s]\r\n178it [00:19, 9.28it/s]\r\n179it [00:19, 9.25it/s]\r\n180it [00:19, 9.38it/s]\r\n181it [00:19, 8.94it/s]\r\n182it [00:19, 9.03it/s]\r\n184it [00:20, 9.40it/s]\r\n185it [00:20, 9.31it/s]\r\n186it [00:20, 9.12it/s]\r\n187it [00:20, 9.12it/s]\r\n189it [00:20, 9.14it/s]\r\n190it [00:20, 9.20it/s]\r\n191it [00:20, 9.04it/s]\r\n192it [00:20, 9.15it/s]\r\n193it [00:21, 9.32it/s]\r\n195it [00:21, 9.46it/s]\r\n196it [00:21, 9.12it/s]\r\n197it [00:21, 9.22it/s]\r\n198it [00:21, 9.31it/s]\r\n200it [00:21, 9.40it/s]\r\n201it [00:21, 9.16it/s]\r\n203it [00:22, 9.14it/s]\r\n204it [00:22, 9.25it/s]\r\n205it [00:22, 9.10it/s]\r\n207it [00:22, 9.47it/s]\r\n208it [00:22, 9.12it/s]\r\n209it [00:22, 9.09it/s]\r\n210it [00:22, 9.03it/s]\r\n212it [00:23, 9.32it/s]\r\n213it [00:23, 9.41it/s]\r\n214it [00:23, 9.46it/s]\r\n215it [00:23, 9.24it/s]\r\n216it [00:23, 9.07it/s]\r\n217it [00:23, 9.17it/s]\r\n218it [00:23, 9.39it/s]\r\n219it [00:23, 9.33it/s]\r\n221it [00:24, 9.29it/s]\r\n222it [00:24, 9.33it/s]\r\n223it [00:24, 9.43it/s]\r\n224it [00:24, 9.02it/s]\r\n226it [00:24, 9.14it/s]\r\n227it [00:24, 9.23it/s]\r\n228it [00:24, 9.10it/s]\r\n229it [00:24, 9.22it/s]\r\n230it [00:25, 9.22it/s]\r\n231it [00:25, 9.30it/s]\r\n232it [00:25, 9.24it/s]\r\n233it [00:25, 9.16it/s]\r\n235it [00:25, 9.54it/s]\r\n236it [00:25, 9.54it/s]\r\n237it [00:25, 9.46it/s]\r\n238it [00:25, 9.00it/s]\r\n239it [00:25, 9.17it/s]\r\n240it [00:26, 9.11it/s]\r\n241it [00:26, 9.14it/s]\r\n242it [00:26, 9.09it/s]\r\n243it [00:26, 9.25it/s]\r\n244it [00:26, 9.01it/s]\r\n246it [00:26, 9.20it/s]\r\n247it [00:26, 9.18it/s]\r\n249it [00:27, 9.37it/s]\r\n250it [00:27, 9.47it/s]\r\n251it [00:27, 9.16it/s]\r\n252it [00:27, 8.83it/s]\r\n253it [00:27, 9.04it/s]\r\n255it [00:27, 9.16it/s]\r\n256it [00:27, 9.20it/s]\r\n258it [00:28, 9.52it/s]\r\n259it [00:28, 9.43it/s]\r\n260it [00:28, 9.43it/s]\r\n261it [00:28, 9.40it/s]\r\n262it [00:28, 9.21it/s]\r\n263it [00:28, 9.34it/s]\r\n264it [00:28, 9.30it/s]\r\n265it [00:28, 9.33it/s]\r\n266it [00:28, 9.24it/s]\r\n267it [00:29, 9.31it/s]\r\n268it [00:29, 9.29it/s]\r\n269it [00:29, 9.30it/s]\r\n270it [00:29, 9.15it/s]\r\n271it [00:29, 9.33it/s]\r\n272it [00:29, 9.33it/s]\r\n273it [00:29, 9.05it/s]\r\n274it [00:29, 9.26it/s]\r\n275it [00:29, 9.21it/s]\r\n276it [00:29, 9.32it/s]\r\n277it [00:30, 9.35it/s]\r\n278it [00:30, 9.04it/s]\r\n279it [00:30, 9.09it/s]\r\n281it [00:30, 9.10it/s]\r\n282it [00:30, 8.97it/s]\r\n284it [00:30, 9.10it/s]\r\n285it [00:30, 9.11it/s]\r\n286it [00:31, 9.09it/s]\r\n288it [00:31, 9.26it/s]\r\n289it [00:31, 9.30it/s]\r\n290it [00:31, 9.16it/s]\r\n291it [00:31, 9.29it/s]\r\n292it [00:31, 9.28it/s]\r\n293it [00:31, 9.40it/s]\r\n294it [00:31, 9.12it/s]\r\n296it [00:32, 9.48it/s]\r\n297it [00:32, 9.44it/s]\r\n298it [00:32, 9.40it/s]\r\n299it [00:32, 9.22it/s]\r\n300it [00:32, 9.40it/s]\r\n301it [00:32, 9.34it/s]\r\n301it [00:32, 9.21it/s]",
"output": [
"https://replicate.delivery/mgxm/129d24dc-e39e-4240-8978-88420cc1f910/out-0.png"
],
"data_removed": false,
"error": "",
"source": "web",
"status": "succeeded",
"created_at": "2022-08-23T00:25:55.134698Z",
"started_at": "2022-08-23T00:25:55Z",
"completed_at": "2022-08-23T00:26:28Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/rjcl54wakbbrfcajzllmidreya/cancel",
"get": "https://api.replicate.com/v1/predictions/rjcl54wakbbrfcajzllmidreya"
},
"metrics": {
"predict_time": 33,
"total_time": 32.865302
}
}