import os
import requests
# Constants
ENDPOINT = "https://hyperhuman.deemos.com/api/v2/rodin"
API_KEY = "your api key" # Replace with your actual API key
IMAGE_PATH = "/path/to/your/image.jpg" # Replace with the path to your image
# Prepare the multipart form data
files = [
('images', open(IMAGE_PATH, 'rb')),
]
# Prepare the headers
headers = {
'Authorization': f'Bearer {API_KEY}',
}
# Make the POST request
response = requests.post(ENDPOINT, files=files, headers=headers)
# Parse and return the JSON response
print(response.json())
package main
import (
"bytes"
"encoding/json"
"fmt"
"mime/multipart"
"net/http"
"os"
"path/filepath"
)
const BaseURI = "https://hyperhuman.deemos.com/api"
type CommonError struct {
Error *string `json:"error,omitempty"`
Message *string `json:"message,omitempty"`
}
type JobSubmissionResponse struct {
Uuids []string `json:"uuids"`
SubscriptionKey string `json:"subscription_key"`
}
type RodinAllInOneResponse struct {
CommonError
Uuid *string `json:"uuid,omitempty"`
Jobs JobSubmissionResponse `json:"jobs,omitempty"`
}
func RunRodin(token string, filePath string) (*RodinAllInOneResponse, error) {
var err error
var buffer bytes.Buffer
// Create the form data for Rodin API
writer := multipart.NewWriter(&buffer)
// Read the image
image, err := os.ReadFile(filePath)
if err != nil {
return nil, err
}
// Add the image as a form entry
fieldWriter, err := writer.CreateFormFile("images", filepath.Base(filePath))
if err != nil {
return nil, err
}
if _, err = fieldWriter.Write(image); err != nil {
return nil, err
}
err = writer.Close()
if err != nil {
return nil, err
}
// Create the request
req, err := http.NewRequest("POST", fmt.Sprintf("%s/v2/rodin", BaseURI), &buffer)
if err != nil {
return nil, err
}
// Set headers
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", writer.FormDataContentType())
resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
var responseData RodinAllInOneResponse
err = json.NewDecoder(resp.Body).Decode(&responseData)
if err != nil {
return nil, err
}
if responseData.Error != nil {
return nil, fmt.Errorf("%s: %s", *responseData.Error, *responseData.Message)
}
return &responseData, nil
}
func main() {
// Replace with your actual API key
token := "your api key"
// Replace with the path to your image
resp, _ := RunRodin(token, "/path/to/your/image.jpg")
fmt.Println(resp)
}
import os
import requests
# Constants
ENDPOINT = "https://hyperhuman.deemos.com/api/v2/rodin"
API_KEY = "your api key" # Replace with your actual API key
IMAGE_PATH = "/path/to/your/image.jpg" # Replace with the path to your image
# Read the image file
with open(IMAGE_PATH, 'rb') as image_file:
image_data = image_file.read()
# Prepare the multipart form data
files = {
'images': (os.path.basename(IMAGE_PATH), image_data, 'image/jpeg')
}
# Set the tier to Rodin Sketch
data = {
'tier': 'Sketch',
}
# Prepare the headers
headers = {
'Authorization': f'Bearer {API_KEY}',
}
# Make the POST request
response = requests.post(ENDPOINT, files=files, data=data, headers=headers)
# Parse and return the JSON response
print(response.json())
package main
import (
"bytes"
"encoding/json"
"fmt"
"mime/multipart"
"net/http"
"os"
"path/filepath"
)
const BaseURI = "https://hyperhuman.deemos.com/api"
type CommonError struct {
Error *string `json:"error,omitempty"`
Message *string `json:"message,omitempty"`
}
type JobSubmissionResponse struct {
Uuids []string `json:"uuids"`
SubscriptionKey string `json:"subscription_key"`
}
type RodinAllInOneResponse struct {
CommonError
Uuid *string `json:"uuid,omitempty"`
Jobs JobSubmissionResponse `json:"jobs,omitempty"`
}
func RunRodin(token string, filePath string) (*RodinAllInOneResponse, error) {
var err error
var buffer bytes.Buffer
// Create the form data for Rodin API
writer := multipart.NewWriter(&buffer)
// Read the image
image, err := os.ReadFile(filePath)
if err != nil {
return nil, err
}
// Add the image as a form entry
fieldWriter, err := writer.CreateFormFile("images", filepath.Base(filePath))
if err != nil {
return nil, err
}
if _, err = fieldWriter.Write(image); err != nil {
return nil, err
}
// Set the tier to Rodin Sketch
fieldWriter, err = writer.CreateFormField("tier")
if err != nil {
return nil, err
}
if _, err = fieldWriter.Write([]byte("Sketch")); err != nil {
return nil, err
}
err = writer.Close()
if err != nil {
return nil, err
}
// Create the request
req, err := http.NewRequest("POST", fmt.Sprintf("%s/v2/rodin", BaseURI), &buffer)
if err != nil {
return nil, err
}
// Set headers
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", writer.FormDataContentType())
resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
var responseData RodinAllInOneResponse
err = json.NewDecoder(resp.Body).Decode(&responseData)
if err != nil {
return nil, err
}
if responseData.Error != nil {
return nil, fmt.Errorf("%s: %s", *responseData.Error, *responseData.Message)
}
return &responseData, nil
}
func main() {
// Replace with your actual API key
token := "your api key"
// Replace with the path to your image
resp, _ := RunRodin(token, "/path/to/your/image.jpg")
fmt.Println(resp)
}
export RODIN_API_KEY="your api key"
curl https://hyperhuman.deemos.com/api/v2/rodin \
-H "Authorization: Bearer ${RODIN_API_KEY}" \
-F "prompt=A 3D model of a futuristic robot" \
unset RODIN_API_KEY
import os
import requests
# Constants
ENDPOINT = "https://hyperhuman.deemos.com/api/v2/rodin"
API_KEY = "your api key" # Replace with your actual API key
IMAGE_PATH_0 = "/path/to/your/image_0.jpg" # Replace with the path to your image_0
IMAGE_PATH_1 = "/path/to/your/image_1.jpg" # Replace with the path to your image_1
# Prepare the multipart form data
files = [
('images', open(IMAGE_PATH_0, 'rb')),
('images', open(IMAGE_PATH_1, 'rb')),
]
# Prepare the headers
headers = {
'Authorization': f'Bearer {API_KEY}',
}
# Make the POST request
response = requests.post(ENDPOINT, files=files, headers=headers)
# Parse and return the JSON response
print(response.json())
import os
import requests
# Constants
ENDPOINT = "https://hyperhuman.deemos.com/api/v2/rodin"
API_KEY = "your api key" # Replace with your actual API key
IMAGE_PATH = "/path/to/your/image.jpg" # Replace with the path to your image
# Read the image file
with open(IMAGE_PATH, 'rb') as image_file:
image_data = image_file.read()
# Prepare the images data
# Prepare the Bounding Box data
files = {
'images': (os.path.basename(IMAGE_PATH), image_data, 'image/jpeg')
'bbox_condition':(None, "[100, 100, 100]"),
}
# Prepare the headers
headers = {
'Authorization': f'Bearer {API_KEY}',
}
# Make the POST request
response = requests.post(ENDPOINT, files=files, headers=headers)
# Parse and return the JSON response
print(response.json())
{
"error": null,
"message": "Submitted. Please check progress via /api/v2/status and get download link via /api/v2/download",
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"jobs": {
"uuids": ["job-uuid-1", "job-uuid-2"],
"subscription_key": "sub-key-1"
}
}
Comprehensive Rodin Regular Generation with All Parameters
export RODIN_API_KEY="your api key"
curl https://hyperhuman.deemos.com/api/v2/rodin \
-H "Authorization: Bearer ${RODIN_API_KEY}" \
-F "images=@/path/to/your/image.jpg" \
-F "prompt=A 3D model of a futuristic robot" \
-F "seed=42" \
-F "geometry_file_format=fbx" \
-F "material=PBR" \
-F "quality=high" \
-F "use_hyper=true" \
-F "tier=Regular" \
-F "addons=HighPack"
unset RODIN_API_KEY