diff --git a/ui/sd_internal/__init__.py b/ui/sd_internal/__init__.py index f0710652..7093562a 100644 --- a/ui/sd_internal/__init__.py +++ b/ui/sd_internal/__init__.py @@ -48,6 +48,9 @@ class Response: self.images = images def json(self): + del self.render_request.init_image + del self.render_request.init_image_mask + res = { "status": 'succeeded', "render_request": self.render_request.dict(), diff --git a/ui/sd_internal/renderer.py b/ui/sd_internal/renderer.py index aa805ad9..162b7da0 100644 --- a/ui/sd_internal/renderer.py +++ b/ui/sd_internal/renderer.py @@ -33,7 +33,7 @@ def init(device): device_manager.device_init(context, device) def make_images(req: GenerateImageRequest, task_data: TaskData, data_queue: queue.Queue, task_temp_images: list, step_callback): - log.info(f'request: {req.dict()}') + log.info(f'request: {get_printable_request(req)}') log.info(f'task data: {task_data.dict()}') try: @@ -120,9 +120,7 @@ def construct_response(images: list, task_data: TaskData, base_seed: int): ] def get_metadata_entries(req: GenerateImageRequest, task_data: TaskData): - metadata = req.dict() - del metadata['init_image'] - del metadata['init_image_mask'] + metadata = get_printable_request(req) metadata.update({ 'use_stable_diffusion_model': task_data.use_stable_diffusion_model, 'use_vae_model': task_data.use_vae_model, @@ -133,6 +131,12 @@ def get_metadata_entries(req: GenerateImageRequest, task_data: TaskData): return [metadata.copy().update({'seed': req.seed + i}) for i in range(req.num_outputs)] +def get_printable_request(req: GenerateImageRequest): + metadata = req.dict() + del metadata['init_image'] + del metadata['init_image_mask'] + return metadata + def make_filename_callback(req: GenerateImageRequest, suffix=None): def make_filename(i): img_id = base64.b64encode(int(time.time()+i).to_bytes(8, 'big')).decode() # Generate unique ID based on time.