1
0
forked from cgvr/DeltaVR

added more time logging to python script + switched to using CGVR lab WiFi

This commit is contained in:
2026-01-11 12:34:08 +02:00
parent 997bb457ba
commit a23f40787e
4 changed files with 11 additions and 7 deletions

View File

@@ -6,6 +6,7 @@ import json
import logging import logging
import httpx import httpx
import os import os
import time
from typing import Optional from typing import Optional
from urllib.parse import urljoin from urllib.parse import urljoin
@@ -493,6 +494,8 @@ async def text_to_image_invoke_ai(prompt, output_path):
"model_key": INVOKEAI_MODEL_KEY "model_key": INVOKEAI_MODEL_KEY
} }
image_url = await generate_image(args) image_url = await generate_image(args)
print("Got image url:", image_url) print("Downloading image from", image_url)
print("Downloading image file...") time_start = time.time()
download_file(image_url, output_path) download_file(image_url, output_path)
download_time = time.time() - time_start
print(f"Image downloaded in {round(download_time, 1)} seconds")

View File

@@ -32,7 +32,7 @@ def generate_no_preview(image_base64: str):
} }
# Start generation # Start generation
print("Starting generation...") print("Generating model...")
response = requests.post(f"{API_URL}/generate_no_preview", data=params) response = requests.post(f"{API_URL}/generate_no_preview", data=params)
response.raise_for_status() response.raise_for_status()
@@ -50,8 +50,11 @@ def generate_no_preview(image_base64: str):
# Download the model # Download the model
print("Downloading model...") print("Downloading model...")
time_start = time.time()
response = requests.get(f"{API_URL}/download/model") response = requests.get(f"{API_URL}/download/model")
response.raise_for_status() response.raise_for_status()
time_download = time.time() - time_start
print(f"Model downloaded in {round(time_download, 1)} seconds")
return response.content return response.content

View File

@@ -41,8 +41,6 @@ async def main():
time_checkpoint = time.time() time_checkpoint = time.time()
image_path = pipeline_folder / "images" / f"{timestamp}.jpg" 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) await text_to_image_invoke_ai(image_generation_prompt, image_path)
image_generation_time = time.time() - time_checkpoint image_generation_time = time.time() - time_checkpoint