defaultA fantasy landscape, trending on artstation
typetext
{
"guidance_scale": 7.5,
"height": 512,
"image": "https://replicate.delivery/pbxt/JHT88iNscz4MMEmzE5FE5Il5cFOjlVKKgNJ752VdONnDwoE6/mars_landscape.jpeg",
"num_inference_steps": 25,
"num_outputs": 1,
"prompt": "A Vincent Van Gogh's starry nights landascape of plant mars",
"prompt_strength": 0.8,
"scheduler": "DPMSolverMultistep",
"width": 512
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_IwZ**********************************
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 abdullahmakhdoom/diffusers-txtnimg2img using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"abdullahmakhdoom/diffusers-txtnimg2img:d8019f36ecde068f82adb2337c187219f4997f26606c38f7f4002115bdc3991d",
{
input: {
guidance_scale: 7.5,
height: 512,
image: "https://replicate.delivery/pbxt/JHT88iNscz4MMEmzE5FE5Il5cFOjlVKKgNJ752VdONnDwoE6/mars_landscape.jpeg",
num_inference_steps: 25,
num_outputs: 1,
prompt: "A Vincent Van Gogh's starry nights landascape of plant mars",
prompt_strength: 0.8,
scheduler: "DPMSolverMultistep",
width: 512
}
}
);
// 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_IwZ**********************************
This is your API token. Keep it to yourself.
import replicate
Run abdullahmakhdoom/diffusers-txtnimg2img using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"abdullahmakhdoom/diffusers-txtnimg2img:d8019f36ecde068f82adb2337c187219f4997f26606c38f7f4002115bdc3991d",
input={
"guidance_scale": 7.5,
"height": 512,
"image": "https://replicate.delivery/pbxt/JHT88iNscz4MMEmzE5FE5Il5cFOjlVKKgNJ752VdONnDwoE6/mars_landscape.jpeg",
"num_inference_steps": 25,
"num_outputs": 1,
"prompt": "A Vincent Van Gogh's starry nights landascape of plant mars",
"prompt_strength": 0.8,
"scheduler": "DPMSolverMultistep",
"width": 512
}
)
# 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_IwZ**********************************
This is your API token. Keep it to yourself.
Run abdullahmakhdoom/diffusers-txtnimg2img 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": "abdullahmakhdoom/diffusers-txtnimg2img:d8019f36ecde068f82adb2337c187219f4997f26606c38f7f4002115bdc3991d",
"input": {
"guidance_scale": 7.5,
"height": 512,
"image": "https://replicate.delivery/pbxt/JHT88iNscz4MMEmzE5FE5Il5cFOjlVKKgNJ752VdONnDwoE6/mars_landscape.jpeg",
"num_inference_steps": 25,
"num_outputs": 1,
"prompt": "A Vincent Van Gogh\'s starry nights landascape of plant mars",
"prompt_strength": 0.8,
"scheduler": "DPMSolverMultistep",
"width": 512
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "skxh2lbbc4yyexf43btnihh5oi",
"model": "abdullahmakhdoom/diffusers-txtnimg2img",
"version": "d8019f36ecde068f82adb2337c187219f4997f26606c38f7f4002115bdc3991d",
"input": {
"guidance_scale": 7.5,
"height": 512,
"image": "https://replicate.delivery/pbxt/JHT88iNscz4MMEmzE5FE5Il5cFOjlVKKgNJ752VdONnDwoE6/mars_landscape.jpeg",
"num_inference_steps": 25,
"num_outputs": 1,
"prompt": "A Vincent Van Gogh's starry nights landascape of plant mars",
"prompt_strength": 0.8,
"scheduler": "DPMSolverMultistep",
"width": 512
},
"logs": "Using seed: 62186\n 0%| | 0/20 [00:00<?, ?it/s]\n 5%|▌ | 1/20 [00:02<00:38, 2.04s/it]\n 10%|█ | 2/20 [00:04<00:35, 2.00s/it]\n 15%|█▌ | 3/20 [00:05<00:33, 1.95s/it]\n 20%|██ | 4/20 [00:07<00:31, 1.97s/it]\n 25%|██▌ | 5/20 [00:09<00:29, 1.95s/it]\n 30%|███ | 6/20 [00:12<00:28, 2.06s/it]\n 35%|███▌ | 7/20 [00:14<00:28, 2.22s/it]\n 40%|████ | 8/20 [00:17<00:29, 2.47s/it]\n 45%|████▌ | 9/20 [00:20<00:28, 2.63s/it]\n 50%|█████ | 10/20 [00:23<00:27, 2.74s/it]\n 55%|█████▌ | 11/20 [00:26<00:24, 2.76s/it]\n 60%|██████ | 12/20 [00:29<00:22, 2.79s/it]\n 65%|██████▌ | 13/20 [00:32<00:19, 2.81s/it]\n 70%|███████ | 14/20 [00:34<00:16, 2.82s/it]\n 75%|███████▌ | 15/20 [00:37<00:14, 2.81s/it]\n 80%|████████ | 16/20 [00:40<00:11, 2.79s/it]\n 85%|████████▌ | 17/20 [00:42<00:08, 2.69s/it]\n 90%|█████████ | 18/20 [00:45<00:05, 2.74s/it]\n 95%|█████████▌| 19/20 [00:48<00:02, 2.79s/it]\n100%|██████████| 20/20 [00:51<00:00, 2.83s/it]\n100%|██████████| 20/20 [00:51<00:00, 2.58s/it]",
"output": [
"https://replicate.delivery/pbxt/mD1kKoRpPz55LF39jW7iOVYMk9XYxiMPHFMcEBgAdtAwngVE/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-08-02T15:19:54.939618Z",
"started_at": "2023-08-02T15:25:58.758737Z",
"completed_at": "2023-08-02T15:26:56.255685Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/skxh2lbbc4yyexf43btnihh5oi/cancel",
"get": "https://api.replicate.com/v1/predictions/skxh2lbbc4yyexf43btnihh5oi"
},
"metrics": {
"predict_time": 57.496948,
"total_time": 421.316067
}
}
