typefile
{
"input_image": "https://replicate.delivery/pbxt/HoXVxficc1DZUGI3DJdFRDZ4lFvtlIUOgYi1J9QWRx50zXSW/asd2.png",
"num_steps": 100
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_WlP**********************************
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 arielreplicate/infinite_nature using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"arielreplicate/infinite_nature:0390823423c0e3f48716320993c7237c4398fbb8b2949e83eb208cbac06ac13a",
{
input: {
input_image: "https://replicate.delivery/pbxt/HoXVxficc1DZUGI3DJdFRDZ4lFvtlIUOgYi1J9QWRx50zXSW/asd2.png",
num_steps: 100
}
}
);
// 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_WlP**********************************
This is your API token. Keep it to yourself.
import replicate
Run arielreplicate/infinite_nature using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"arielreplicate/infinite_nature:0390823423c0e3f48716320993c7237c4398fbb8b2949e83eb208cbac06ac13a",
input={
"input_image": "https://replicate.delivery/pbxt/HoXVxficc1DZUGI3DJdFRDZ4lFvtlIUOgYi1J9QWRx50zXSW/asd2.png",
"num_steps": 100
}
)
# 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_WlP**********************************
This is your API token. Keep it to yourself.
Run arielreplicate/infinite_nature 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": "arielreplicate/infinite_nature:0390823423c0e3f48716320993c7237c4398fbb8b2949e83eb208cbac06ac13a",
"input": {
"input_image": "https://replicate.delivery/pbxt/HoXVxficc1DZUGI3DJdFRDZ4lFvtlIUOgYi1J9QWRx50zXSW/asd2.png",
"num_steps": 100
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "zo7b7dm7kneibaaj5o3htco7ku",
"model": "arielreplicate/infinite_nature",
"version": "0390823423c0e3f48716320993c7237c4398fbb8b2949e83eb208cbac06ac13a",
"input": {
"input_image": "https://replicate.delivery/pbxt/HoXVxficc1DZUGI3DJdFRDZ4lFvtlIUOgYi1J9QWRx50zXSW/asd2.png",
"num_steps": 100
},
"logs": "############ predict ############\ninitialize\ndevice: cpu\nstart processing\nprocessing input/tmp2bypxxl6asd2.png (1/2)\n/root/.pyenv/versions/3.8.15/lib/python3.8/site-packages/torch/nn/functional.py:3609: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.\nwarnings.warn(\nprocessing input/tmpqe229exvtokyo2.jpg (2/2)\nfinished\n2022-11-19 11:14:49.871745: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n2022-11-19 11:14:49.873330: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties:\npciBusID: 0000:00:04.0 name: Tesla T4 computeCapability: 7.5\ncoreClock: 1.59GHz coreCount: 40 deviceMemorySize: 14.75GiB deviceMemoryBandwidth: 298.08GiB/s\n2022-11-19 11:14:49.873668: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1\n2022-11-19 11:14:49.874219: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10\n2022-11-19 11:14:49.874510: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10\n2022-11-19 11:14:49.874831: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10\n2022-11-19 11:14:49.875148: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10\n2022-11-19 11:14:49.875399: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10\n2022-11-19 11:14:49.875657: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7\n2022-11-19 11:14:49.876024: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n2022-11-19 11:14:49.876551: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n2022-11-19 11:14:49.876940: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0\n2022-11-19 11:14:49.877225: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix:\n2022-11-19 11:14:49.877457: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108] 0\n2022-11-19 11:14:49.877632: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 0: N\n2022-11-19 11:14:49.878121: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n2022-11-19 11:14:49.878566: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n2022-11-19 11:14:49.879090: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1247] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 14109 MB memory) -> physical GPU (device: 0, name: Tesla T4, pci bus id: 0000:00:04.0, compute capability: 7.5)\nRestoring from ckpt/model.ckpt-6935893\nModel restored.\n0 / 100 frames generated\ntime / step: 0.712751",
"output": "https://replicate.delivery/pbxt/kwoII9ANIU4AFZRzI3i1dHJEDNfwQI7CohseU6yj6ZyzymBQA/output_video.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-11-19T11:14:36.340498Z",
"started_at": "2022-11-19T11:14:36.379771Z",
"completed_at": "2022-11-19T11:15:00.665606Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/zo7b7dm7kneibaaj5o3htco7ku/cancel",
"get": "https://api.replicate.com/v1/predictions/zo7b7dm7kneibaaj5o3htco7ku"
},
"metrics": {
"predict_time": 24.285835,
"total_time": 24.325108
}
}