MCPcopy Create free account
hub / github.com/easydiffusion/easydiffusion / update_temp_img

Function update_temp_img

ui/easydiffusion/tasks/render_images.py:280–297  ·  view source on GitHub ↗
(images, task_temp_images: list)

Source from the content-addressed store, hash-verified

278 last_callback_time = -1
279
280 def update_temp_img(images, task_temp_images: list):
281 partial_images = []
282
283 if images is None:
284 return []
285
286 if task_data.block_nsfw:
287 images = filter_nsfw(images, print_log=False)
288
289 for i, img in enumerate(images):
290 img = img.convert("RGB")
291 img = resize_img(img, req.width, req.height)
292 buf = img_to_buffer(img, output_format="JPEG")
293
294 task_temp_images[i] = buf
295 partial_images.append({"path": f"/image/tmp/{task_data.request_id}/{i}"})
296 del images
297 return partial_images
298
299 def on_image_step(images, i, *args):
300 nonlocal last_callback_time

Callers 1

on_image_stepFunction · 0.85

Calls 2

filter_nsfwFunction · 0.90
appendMethod · 0.80

Tested by

no test coverage detected