From 530b48e2dce027dab3eca659e08f1736708a7236 Mon Sep 17 00:00:00 2001
From: hit-cxf <2024111082@stu.hit.edu.cn>
Date: Wed, 13 May 2026 21:36:47 +0800
Subject: [PATCH] 接入Pixelle的html模版

---
 aigc-director/aigc-claw/backend/models/image_client.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/aigc-director/aigc-claw/backend/models/image_client.py b/aigc-director/aigc-claw/backend/models/image_client.py
index 7e9eef0..a982fcf 100644
--- a/aigc-director/aigc-claw/backend/models/image_client.py
+++ b/aigc-director/aigc-claw/backend/models/image_client.py
@@ -1,4 +1,5 @@
 import os
+import re
 import time
 import uuid
 import logging
@@ -75,7 +76,8 @@
             save_dir: Custom directory to save downloaded images.
             session_id: Session ID for organizing saved files.
             video_ratio: Aspect ratio of the video, e.g., "16:9", "9:16", "4:3", "3:4", "1:1".
-            resolution: Resolution string, e.g., "720P", "1080P", "2K", "4K".
+            resolution: Resolution string, e.g., "720P", "1080P", "2K", "4K",
+                or an exact media-slot size such as "1024*1024".
 
         Returns:
             List of absolute file paths of the generated images.
@@ -114,8 +116,12 @@
             }
         }
         
+        custom_size = None
+        if isinstance(resolution, str) and re.match(r"^\d+[x*]\d+$", resolution):
+            custom_size = resolution.replace("x", "*")
+
         # Default fallback if ratio or resolution is not found
-        size = size_map.get(video_ratio, size_map["16:9"]).get(resolution, "1920*1080")
+        size = custom_size or size_map.get(video_ratio, size_map["16:9"]).get(resolution, "1920*1080")
 
         if not model:
             model = "wan2.7-image"  # Default model

--
Gitblit v1.8.0