mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
@@ -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