mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
@@ -296,7 +296,7 @@ class APIControl:
|
||||
output_info += item
|
||||
else:
|
||||
pass
|
||||
shared.state.end(jobid)
|
||||
shared.state.end(jobid, api=False)
|
||||
|
||||
# return
|
||||
b64images = list(map(helpers.encode_pil_to_base64, output_images)) if send_images else []
|
||||
|
||||
@@ -120,7 +120,7 @@ class APIGenerate:
|
||||
processed = process_images(p)
|
||||
processed = scripts_manager.scripts_txt2img.after(p, processed, *script_args)
|
||||
p.close()
|
||||
shared.state.end(jobid)
|
||||
shared.state.end(jobid, api=False)
|
||||
if processed is None or processed.images is None or len(processed.images) == 0:
|
||||
b64images = []
|
||||
else:
|
||||
@@ -173,7 +173,7 @@ class APIGenerate:
|
||||
processed = process_images(p)
|
||||
processed = scripts_manager.scripts_img2img.after(p, processed, *script_args)
|
||||
p.close()
|
||||
shared.state.end(jobid)
|
||||
shared.state.end(jobid, api=False)
|
||||
if processed is None or processed.images is None or len(processed.images) == 0:
|
||||
b64images = []
|
||||
else:
|
||||
|
||||
@@ -82,7 +82,7 @@ class APIProcess:
|
||||
jobid = shared.state.begin('API-PRE', api=True)
|
||||
processed = processor(image, local_config=req.params)
|
||||
image = encode_pil_to_base64(processed)
|
||||
shared.state.end(jobid)
|
||||
shared.state.end(jobid, api=False)
|
||||
return ResPreprocess(model=processor.processor_id, image=image)
|
||||
|
||||
def get_mask(self):
|
||||
@@ -110,7 +110,7 @@ class APIProcess:
|
||||
jobid = shared.state.begin('API-MASK', api=True)
|
||||
with self.queue_lock:
|
||||
processed = masking.run_mask(input_image=image, input_mask=mask, return_type=req.type)
|
||||
shared.state.end(jobid)
|
||||
shared.state.end(jobid, api=False)
|
||||
if processed is None:
|
||||
return JSONResponse(status_code=400, content={"error": "Mask is none"})
|
||||
image = encode_pil_to_base64(processed)
|
||||
@@ -134,7 +134,7 @@ class APIProcess:
|
||||
classes.append(item.cls)
|
||||
labels.append(item.label)
|
||||
boxes.append(item.box)
|
||||
shared.state.end(jobid)
|
||||
shared.state.end(jobid, api=False)
|
||||
return ResFace(classes=classes, labels=labels, scores=scores, boxes=boxes, images=images)
|
||||
|
||||
def post_prompt_enhance(self, req: models.ReqPromptEnhance):
|
||||
|
||||
Reference in New Issue
Block a user