{
"aspect_ratio": "1:1",
"cfg": 1,
"output_format": "webp",
"output_quality": 90,
"prompt": "a claymation dinosaur with a giant taco in its mouth, set against a bright and colorful background. Holding a sign that says 'Eat Moar Tacos'",
"prompt_strength": 0.85,
"steps": 4
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_daV**********************************
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-3.5-large-turbo using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "1:1",
cfg: 1,
output_format: "webp",
output_quality: 90,
prompt: "a claymation dinosaur with a giant taco in its mouth, set against a bright and colorful background. Holding a sign that says 'Eat Moar Tacos'",
prompt_strength: 0.85,
steps: 4
};
const output = await replicate.run("stability-ai/stable-diffusion-3.5-large-turbo", { input });
// 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_daV**********************************
This is your API token. Keep it to yourself.
import replicate
Run stability-ai/stable-diffusion-3.5-large-turbo using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"stability-ai/stable-diffusion-3.5-large-turbo",
input={
"aspect_ratio": "1:1",
"cfg": 1,
"output_format": "webp",
"output_quality": 90,
"prompt": "a claymation dinosaur with a giant taco in its mouth, set against a bright and colorful background. Holding a sign that says 'Eat Moar Tacos'",
"prompt_strength": 0.85,
"steps": 4
}
)
# 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_daV**********************************
This is your API token. Keep it to yourself.
Run stability-ai/stable-diffusion-3.5-large-turbo 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 $'{
"input": {
"aspect_ratio": "1:1",
"cfg": 1,
"output_format": "webp",
"output_quality": 90,
"prompt": "a claymation dinosaur with a giant taco in its mouth, set against a bright and colorful background. Holding a sign that says \'Eat Moar Tacos\'",
"prompt_strength": 0.85,
"steps": 4
}
}' \
https://api.replicate.com/v1/models/stability-ai/stable-diffusion-3.5-large-turbo/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "7bbrdq5sg9rm20cjvdt9whw6g8",
"model": "stability-ai/stable-diffusion-3.5-large-turbo",
"version": "hidden",
"input": {
"aspect_ratio": "1:1",
"cfg": 1,
"output_format": "webp",
"output_quality": 90,
"prompt": "a claymation dinosaur with a giant taco in its mouth, set against a bright and colorful background. Holding a sign that says 'Eat Moar Tacos'",
"prompt_strength": 0.85,
"steps": 4
},
"logs": "Seed set to: 3621234145\nRunning workflow\ngot prompt\nExecuting node 294, title: KSampler, class type: KSampler\n0%| | 0/4 [00:00<?, ?it/s]\n50%|█████ | 2/4 [00:00<00:00, 8.98it/s]\n75%|███████▌ | 3/4 [00:00<00:00, 8.99it/s]\n100%|██████████| 4/4 [00:00<00:00, 9.00it/s]\n100%|██████████| 4/4 [00:00<00:00, 8.99it/s]\nExecuting node 8, title: VAE Decode, class type: VAEDecode\nExecuting node 309, title: Save Image, class type: SaveImage\nPrompt executed in 0.71 seconds\noutputs: {'309': {'images': [{'filename': 'R8_sd3.5L_00001_.png', 'subfolder': '', 'type': 'output'}]}}\n====================================\nR8_sd3.5L_00001_.png",
"output": [
"https://replicate.delivery/yhqm/iXeopZ5VrDXwa6UMqHCzL167yNdE4VDhXYy4UnYtVzlMy61JA/R8_sd3.5L_00001_.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-10-30T03:25:12.962Z",
"started_at": "2024-10-30T03:25:12.967483Z",
"completed_at": "2024-10-30T03:25:13.819946Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/7bbrdq5sg9rm20cjvdt9whw6g8/cancel",
"get": "https://api.replicate.com/v1/predictions/7bbrdq5sg9rm20cjvdt9whw6g8",
"stream": "https://stream.replicate.com/v1/files/wcdb-pgrelahvylsjz3nvd25hjtwksq77rlnzd7raymdm5gy4yzp776fq",
"web": "https://replicate.com/p/7bbrdq5sg9rm20cjvdt9whw6g8"
},
"metrics": {
"image_count": 1,
"predict_time": 0.852462802,
"total_time": 0.857946
}
}