[Bugfix] fix request_id of image generation in api server (#1112)
Signed-off-by: zjy0516 <riverclouds.zhu@qq.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
f6cfc0d1e3
commit
8ad39570b8
3 files changed
+89
-25
No files matched your search
@@ -7,6 +7,7 @@ import os
|
||||
# Image generation API imports
|
||||
import random
|
||||
import time
|
||||
import uuid
|
||||
from argparse import Namespace
|
||||
from collections.abc import AsyncIterator
|
||||
from contextlib import asynccontextmanager
|
||||
@@ -995,7 +996,7 @@ async def generate_images(request: ImageGenerationRequest, raw_request: Request)
|
||||
# might produce blurry images in some environments.
|
||||
gen_params.seed = random.randint(0, 2**32 - 1)
|
||||
|
||||
request_id = f"img_gen_{int(time.time())}"
|
||||
request_id = f"img_gen_{uuid.uuid4().hex}"
|
||||
|
||||
logger.info(f"Generating {request.n} image(s) {size_str}")
|
||||
|
||||
|
||||
Reference in new issue
Block a user