typetext
{
"aspect_ratio": "1:1",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "a dog smiling and looking directly at the camera, wearing a white t-shirt with the word \"HYPER\" printed on it."
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_RHz**********************************
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 bytedance/hyper-flux-8step using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"bytedance/hyper-flux-8step:81946b1e09b256c543b35f37333a30d0d02ee2cd8c4f77cd915873a1ca622bad",
{
input: {
aspect_ratio: "1:1",
guidance_scale: 3.5,
num_inference_steps: 8,
num_outputs: 1,
output_format: "webp",
output_quality: 80,
prompt: "a dog smiling and looking directly at the camera, wearing a white t-shirt with the word \"HYPER\" printed on it."
}
}
);
// 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_RHz**********************************
This is your API token. Keep it to yourself.
import replicate
Run bytedance/hyper-flux-8step using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"bytedance/hyper-flux-8step:81946b1e09b256c543b35f37333a30d0d02ee2cd8c4f77cd915873a1ca622bad",
input={
"aspect_ratio": "1:1",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "a dog smiling and looking directly at the camera, wearing a white t-shirt with the word \"HYPER\" printed on it."
}
)
# 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_RHz**********************************
This is your API token. Keep it to yourself.
Run bytedance/hyper-flux-8step 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": "bytedance/hyper-flux-8step:81946b1e09b256c543b35f37333a30d0d02ee2cd8c4f77cd915873a1ca622bad",
"input": {
"aspect_ratio": "1:1",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "a dog smiling and looking directly at the camera, wearing a white t-shirt with the word \\"HYPER\\" printed on it."
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "zr6w3kzn81rm60cjb6j9sqh5pc",
"model": "bytedance/hyper-flux-8step",
"version": "81946b1e09b256c543b35f37333a30d0d02ee2cd8c4f77cd915873a1ca622bad",
"input": {
"aspect_ratio": "1:1",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "a dog smiling and looking directly at the camera, wearing a white t-shirt with the word \"HYPER\" printed on it."
},
"logs": "Using seed: 63685\nPrompt: a dog smiling and looking directly at the camera, wearing a white t-shirt with the word \"HYPER\" printed on it.\ntxt2img mode\n 0%| | 0/8 [00:00<?, ?it/s]\n 12%|█▎ | 1/8 [00:00<00:01, 4.34it/s]\n 25%|██▌ | 2/8 [00:00<00:01, 5.51it/s]\n 38%|███▊ | 3/8 [00:00<00:01, 4.91it/s]\n 50%|█████ | 4/8 [00:00<00:00, 4.67it/s]\n 62%|██████▎ | 5/8 [00:01<00:00, 4.55it/s]\n 75%|███████▌ | 6/8 [00:01<00:00, 4.46it/s]\n 88%|████████▊ | 7/8 [00:01<00:00, 4.43it/s]\n100%|██████████| 8/8 [00:01<00:00, 4.40it/s]\n100%|██████████| 8/8 [00:01<00:00, 4.55it/s]",
"output": [
"https://replicate.delivery/yhqm/bKCAFhWFtbafL6Q31fEkfzVUKDUxY3GcdU1KGtR1AfRhcHOOB/out-0.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-10-04T22:27:15.904Z",
"started_at": "2024-10-04T22:27:18.223751Z",
"completed_at": "2024-10-04T22:27:20.324335Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/zr6w3kzn81rm60cjb6j9sqh5pc/cancel",
"get": "https://api.replicate.com/v1/predictions/zr6w3kzn81rm60cjb6j9sqh5pc",
"web": "https://replicate.com/p/zr6w3kzn81rm60cjb6j9sqh5pc"
},
"metrics": {
"predict_time": 2.100584142,
"total_time": 4.420335
}
}