typetext
{
"complexity": "advanced",
"physics_type": "rotational_dynamics",
"subject": "a cat"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_R13**********************************
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 fofr/hailuo-02-physics-experiments using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
complexity: "advanced",
physics_type: "rotational_dynamics",
subject: "a cat"
};
const output = await replicate.run("fofr/hailuo-02-physics-experiments", { input });
// 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_R13**********************************
This is your API token. Keep it to yourself.
import replicate
Run fofr/hailuo-02-physics-experiments using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"fofr/hailuo-02-physics-experiments",
input={
"complexity": "advanced",
"physics_type": "rotational_dynamics",
"subject": "a cat"
}
)
# 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_R13**********************************
This is your API token. Keep it to yourself.
Run fofr/hailuo-02-physics-experiments 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": {
"complexity": "advanced",
"physics_type": "rotational_dynamics",
"subject": "a cat"
}
}' \
https://api.replicate.com/v1/models/fofr/hailuo-02-physics-experiments/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "4r38pcspzxrme0cqysv9d0fwc0",
"model": "fofr/hailuo-02-physics-experiments",
"version": "hidden",
"input": {
"complexity": "advanced",
"physics_type": "rotational_dynamics",
"subject": "a cat"
},
"logs": "Generated physics prompt: A fluffy orange cat leaps from a tall wooden bookshelf and performs a dramatic mid-air twist and spin before landing gracefully on a soft cushion below, its body rotating in slow motion against a sunlit library backdrop. The camera follows the cat's descent with a smooth downward arc, capturing every detail of its spinning fur and extended paws as it demonstrates perfect rotational control.",
"output": "https://replicate.delivery/xezq/sPbnD5polmLoAFbdNp6bYMqt6hudpQWYSlu3eJxzUWrDlvfUA/tmp4byyf2bp.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-07-10T22:30:31.935Z",
"started_at": "2025-07-10T22:30:32.489871Z",
"completed_at": "2025-07-10T22:36:55.351346Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/4r38pcspzxrme0cqysv9d0fwc0/cancel",
"children": "https://api.replicate.com/v1/predictions/4r38pcspzxrme0cqysv9d0fwc0/children",
"get": "https://api.replicate.com/v1/predictions/4r38pcspzxrme0cqysv9d0fwc0",
"root": "https://api.replicate.com/v1/predictions/4r38pcspzxrme0cqysv9d0fwc0",
"stream": "https://stream.replicate.com/v1/files/bcwr-5b7bwzmh5o7qgyjupu4idzy6hgcqackjys4flzq7et5d23hquvla",
"web": "https://replicate.com/p/4r38pcspzxrme0cqysv9d0fwc0"
},
"metrics": {
"predict_time": 382.861475648,
"total_time": 383.416346
}
}