1
0
forked from cgvr/DeltaVR

refactor image generation script + env vars

This commit is contained in:
2025-12-17 13:23:59 +02:00
parent 90781191b7
commit 2c19602e9b
3 changed files with 419 additions and 39 deletions

View File

@@ -1,4 +1,3 @@
import subprocess
import os
import time
import requests
@@ -7,29 +6,7 @@ import base64
from dotenv import load_dotenv
load_dotenv()
MODEL_FOLDER = os.environ["MODEL_FOLDER"]
API_URL = os.environ["3D_GENERATION_URL"]
def image_to_3d_subprocess(image_path, output_path):
venv_python = MODEL_FOLDER + r"\.venv\Scripts\python.exe"
script_path = MODEL_FOLDER + r"\run.py"
args = [image_path, "--output-dir", output_path]
command = [venv_python, script_path] + args
try:
# Run the subprocess
result = subprocess.run(command, capture_output=True, text=True)
# Print output and errors
print("STDOUT:\n", result.stdout)
print("STDERR:\n", result.stderr)
print("Return Code:", result.returncode)
except Exception as e:
print(f"Error occurred: {e}")
API_URL = os.environ["TRELLIS_URL"]
def generate_no_preview(image_base64: str):