This commit is contained in:
root 2025-07-10 17:39:29 +08:00
parent 6fc4c8ba97
commit 76fe0d4550
2 changed files with 1 additions and 7 deletions

View File

@ -236,7 +236,6 @@ class APIClient:
elapsed = wait_count * interval elapsed = wait_count * interval
remaining = max(0, timeout - elapsed) remaining = max(0, timeout - elapsed)
progress_msg = f"[运行中] 任务运行中,已等待{elapsed}秒,预计剩余{remaining}秒..." progress_msg = f"[运行中] 任务运行中,已等待{elapsed}秒,预计剩余{remaining}秒..."
logger.info(progress_msg)
if progress_callback: if progress_callback:
progress_callback(progress_msg) progress_callback(progress_msg)
@ -265,7 +264,6 @@ class APIClient:
elapsed = wait_count * interval elapsed = wait_count * interval
remaining = max(0, timeout - elapsed) remaining = max(0, timeout - elapsed)
progress_msg = f"[排队中] 任务排队中,已等待{elapsed}秒,预计剩余{remaining}秒..." progress_msg = f"[排队中] 任务排队中,已等待{elapsed}秒,预计剩余{remaining}秒..."
logger.info(progress_msg)
if progress_callback: if progress_callback:
progress_callback(progress_msg) progress_callback(progress_msg)
time.sleep(interval) time.sleep(interval)

View File

@ -387,11 +387,7 @@ def main():
sys.stdout.flush() sys.stdout.flush()
def progress_callback(message): def progress_callback(message):
try: ...
print(message)
except UnicodeEncodeError:
# Fallback for Windows GBK encoding issues
print(message.encode('utf-8', errors='ignore').decode('utf-8', errors='ignore'))
if args.action == "single": if args.action == "single":
if not args.image or not args.prompt or not args.output: if not args.image or not args.prompt or not args.output: