typetext
{
"cosine_scale": 10,
"guidance_scale": 10,
"img_height": 1920,
"img_width": 1080,
"negative_prompts": "blurry, ugly, poorly drawn, deformed",
"num_inference_steps": 50,
"prompt": "Envision a portrait of a cute cat, her face is framed by a blue headscarf with muted tones of rust and cream. Her eyes are blue like faded denim. Her attire, simple yet dignified",
"resampling_new_p": 0.3,
"resampling_steps": 7,
"rrg_scale": 1000,
"seed": 0,
"view_batch_size": 16
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_DZD**********************************
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 moayedhajiali/elasticdiffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"moayedhajiali/elasticdiffusion:bddc09369f9e622518f6d11daff26723a513714e08830ed053660d8ac44ffe88",
{
input: {
cosine_scale: 10,
guidance_scale: 10,
img_height: 1920,
img_width: 1080,
negative_prompts: "blurry, ugly, poorly drawn, deformed",
num_inference_steps: 50,
prompt: "Envision a portrait of a cute cat, her face is framed by a blue headscarf with muted tones of rust and cream. Her eyes are blue like faded denim. Her attire, simple yet dignified",
resampling_new_p: 0.3,
resampling_steps: 7,
rrg_scale: 1000,
seed: 0,
view_batch_size: 16
}
}
);
// 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_DZD**********************************
This is your API token. Keep it to yourself.
import replicate
Run moayedhajiali/elasticdiffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"moayedhajiali/elasticdiffusion:bddc09369f9e622518f6d11daff26723a513714e08830ed053660d8ac44ffe88",
input={
"cosine_scale": 10,
"guidance_scale": 10,
"img_height": 1920,
"img_width": 1080,
"negative_prompts": "blurry, ugly, poorly drawn, deformed",
"num_inference_steps": 50,
"prompt": "Envision a portrait of a cute cat, her face is framed by a blue headscarf with muted tones of rust and cream. Her eyes are blue like faded denim. Her attire, simple yet dignified",
"resampling_new_p": 0.3,
"resampling_steps": 7,
"rrg_scale": 1000,
"seed": 0,
"view_batch_size": 16
}
)
# 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_DZD**********************************
This is your API token. Keep it to yourself.
Run moayedhajiali/elasticdiffusion 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": "moayedhajiali/elasticdiffusion:bddc09369f9e622518f6d11daff26723a513714e08830ed053660d8ac44ffe88",
"input": {
"cosine_scale": 10,
"guidance_scale": 10,
"img_height": 1920,
"img_width": 1080,
"negative_prompts": "blurry, ugly, poorly drawn, deformed",
"num_inference_steps": 50,
"prompt": "Envision a portrait of a cute cat, her face is framed by a blue headscarf with muted tones of rust and cream. Her eyes are blue like faded denim. Her attire, simple yet dignified",
"resampling_new_p": 0.3,
"resampling_steps": 7,
"rrg_scale": 1000,
"seed": 0,
"view_batch_size": 16
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "3o3quz3bq67inbfoyg7odf7g4u",
"model": "moayedhajiali/elasticdiffusion",
"version": "bddc09369f9e622518f6d11daff26723a513714e08830ed053660d8ac44ffe88",
"input": {
"cosine_scale": 10,
"guidance_scale": 10,
"img_height": 1920,
"img_width": 1080,
"negative_prompts": "blurry, ugly, poorly drawn, deformed",
"num_inference_steps": 50,
"prompt": "Envision a portrait of a cute cat, her face is framed by a blue headscarf with muted tones of rust and cream. Her eyes are blue like faded denim. Her attire, simple yet dignified",
"resampling_new_p": 0.3,
"resampling_steps": 7,
"rrg_scale": 1000,
"seed": 0,
"view_batch_size": 16
},
"logs": "0%| | 0/50 [00:00<?, ?it/s]\n 2%|▏ | 1/50 [00:08<07:19, 8.97s/it]\n 4%|▍ | 2/50 [00:17<07:09, 8.94s/it]\n 6%|▌ | 3/50 [00:26<06:59, 8.93s/it]\n 8%|▊ | 4/50 [00:35<06:51, 8.95s/it]\n 10%|█ | 5/50 [00:44<06:42, 8.94s/it]\n 12%|█▏ | 6/50 [00:53<06:33, 8.94s/it]\n 14%|█▍ | 7/50 [01:02<06:24, 8.94s/it]\n 16%|█▌ | 8/50 [01:11<06:15, 8.94s/it]\n 18%|█▊ | 9/50 [01:20<06:06, 8.94s/it]\n 20%|██ | 10/50 [01:29<05:57, 8.94s/it]\n 22%|██▏ | 11/50 [01:38<05:48, 8.94s/it]\n 24%|██▍ | 12/50 [01:47<05:39, 8.94s/it]\n 26%|██▌ | 13/50 [01:56<05:30, 8.94s/it]\n 28%|██▊ | 14/50 [02:05<05:21, 8.94s/it]\n 30%|███ | 15/50 [02:14<05:12, 8.94s/it]\n 32%|███▏ | 16/50 [02:23<05:04, 8.94s/it]\n 34%|███▍ | 17/50 [02:32<04:55, 8.95s/it]\n 36%|███▌ | 18/50 [02:40<04:46, 8.94s/it]\n 38%|███▊ | 19/50 [02:49<04:37, 8.94s/it]\n 40%|████ | 20/50 [02:58<04:28, 8.94s/it]\n 42%|████▏ | 21/50 [03:07<04:19, 8.95s/it]\n 44%|████▍ | 22/50 [03:16<04:10, 8.95s/it]\n 46%|████▌ | 23/50 [03:25<04:01, 8.96s/it]\n 48%|████▊ | 24/50 [03:34<03:53, 8.97s/it]\n 50%|█████ | 25/50 [03:43<03:44, 8.97s/it]\n 52%|█████▏ | 26/50 [03:52<03:35, 8.96s/it]\n 54%|█████▍ | 27/50 [04:01<03:25, 8.96s/it]\n 56%|█████▌ | 28/50 [04:10<03:17, 8.96s/it]\n 58%|█████▊ | 29/50 [04:19<03:08, 8.96s/it]\n 60%|██████ | 30/50 [04:28<02:59, 8.96s/it]\n 62%|██████▏ | 31/50 [04:37<02:50, 8.96s/it]\n 64%|██████▍ | 32/50 [04:46<02:41, 8.96s/it]\n 66%|██████▌ | 33/50 [04:55<02:32, 8.96s/it]\n 68%|██████▊ | 34/50 [05:04<02:23, 8.97s/it]\n 70%|███████ | 35/50 [05:13<02:14, 8.96s/it]\n 72%|███████▏ | 36/50 [05:22<02:05, 8.96s/it]\n 74%|███████▍ | 37/50 [05:31<01:56, 8.97s/it]\n 76%|███████▌ | 38/50 [05:40<01:47, 8.97s/it]\n 78%|███████▊ | 39/50 [05:49<01:38, 8.96s/it]\n 80%|████████ | 40/50 [05:58<01:29, 8.97s/it]\n 82%|████████▏ | 41/50 [06:07<01:20, 8.97s/it]\n 84%|████████▍ | 42/50 [06:16<01:11, 8.96s/it]\n 86%|████████▌ | 43/50 [06:25<01:02, 8.97s/it]\n 88%|████████▊ | 44/50 [06:33<00:53, 8.96s/it]\n 90%|█████████ | 45/50 [06:42<00:44, 8.96s/it]\n 92%|█████████▏| 46/50 [06:51<00:35, 8.96s/it]\n 94%|█████████▍| 47/50 [07:00<00:26, 8.97s/it]\n 96%|█████████▌| 48/50 [07:09<00:17, 8.96s/it]\n 98%|█████████▊| 49/50 [07:18<00:08, 8.97s/it]\n100%|██████████| 50/50 [07:24<00:00, 8.13s/it]\n100%|██████████| 50/50 [07:24<00:00, 8.90s/it]\n[INFO] Time taken: 445.8617935180664 seconds.",
"output": "https://replicate.delivery/pbxt/cyVqzroYFOaqFdGKQes0HfkoRVfNrA4yA4hfS9KByeYBib0QC/result.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-12-27T20:04:33.339639Z",
"started_at": "2023-12-27T20:04:33.40139Z",
"completed_at": "2023-12-27T20:12:01.223536Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/3o3quz3bq67inbfoyg7odf7g4u/cancel",
"get": "https://api.replicate.com/v1/predictions/3o3quz3bq67inbfoyg7odf7g4u"
},
"metrics": {
"predict_time": 447.822146,
"total_time": 447.883897
}
}