From a23f40787ea4a886aacbd4735fc82d602d02f524 Mon Sep 17 00:00:00 2001 From: henrisel Date: Sun, 11 Jan 2026 12:34:08 +0200 Subject: [PATCH] added more time logging to python script + switched to using CGVR lab WiFi --- 3d-generation-pipeline/generate_image_local.py | 7 +++++-- 3d-generation-pipeline/generate_model_local.py | 5 ++++- 3d-generation-pipeline/start_pipeline.py | 2 -- Assets/_PROJECT/Scenes/DeltaBuilding_base.unity | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/3d-generation-pipeline/generate_image_local.py b/3d-generation-pipeline/generate_image_local.py index 017c4717..9262d66c 100644 --- a/3d-generation-pipeline/generate_image_local.py +++ b/3d-generation-pipeline/generate_image_local.py @@ -6,6 +6,7 @@ import json import logging import httpx import os +import time from typing import Optional from urllib.parse import urljoin @@ -493,6 +494,8 @@ async def text_to_image_invoke_ai(prompt, output_path): "model_key": INVOKEAI_MODEL_KEY } image_url = await generate_image(args) - print("Got image url:", image_url) - print("Downloading image file...") + print("Downloading image from", image_url) + time_start = time.time() download_file(image_url, output_path) + download_time = time.time() - time_start + print(f"Image downloaded in {round(download_time, 1)} seconds") diff --git a/3d-generation-pipeline/generate_model_local.py b/3d-generation-pipeline/generate_model_local.py index aaf6f642..ceba00b2 100644 --- a/3d-generation-pipeline/generate_model_local.py +++ b/3d-generation-pipeline/generate_model_local.py @@ -32,7 +32,7 @@ def generate_no_preview(image_base64: str): } # Start generation - print("Starting generation...") + print("Generating model...") response = requests.post(f"{API_URL}/generate_no_preview", data=params) response.raise_for_status() @@ -50,8 +50,11 @@ def generate_no_preview(image_base64: str): # Download the model print("Downloading model...") + time_start = time.time() response = requests.get(f"{API_URL}/download/model") response.raise_for_status() + time_download = time.time() - time_start + print(f"Model downloaded in {round(time_download, 1)} seconds") return response.content diff --git a/3d-generation-pipeline/start_pipeline.py b/3d-generation-pipeline/start_pipeline.py index 8c79425f..34e64a6b 100644 --- a/3d-generation-pipeline/start_pipeline.py +++ b/3d-generation-pipeline/start_pipeline.py @@ -41,8 +41,6 @@ async def main(): time_checkpoint = time.time() image_path = pipeline_folder / "images" / f"{timestamp}.jpg" - # TODO: use Invoke AI or Cloudflare, depending on env var - #text_to_image_cloudflare(image_generation_prompt, image_path) await text_to_image_invoke_ai(image_generation_prompt, image_path) image_generation_time = time.time() - time_checkpoint diff --git a/Assets/_PROJECT/Scenes/DeltaBuilding_base.unity b/Assets/_PROJECT/Scenes/DeltaBuilding_base.unity index 61877d66..350a0b7f 100644 --- a/Assets/_PROJECT/Scenes/DeltaBuilding_base.unity +++ b/Assets/_PROJECT/Scenes/DeltaBuilding_base.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f2b6c8a8e5bfe7d97682d3a98f1d764527713231a2c82e5fc723e4ddfd2ccff1 -size 67776439 +oid sha256:1e7d65073e429cc8b3d19084930ea4190df3de841a0704c21929986583ccc1cb +size 67776862