Update api.py
This commit is contained in:
parent
99013ba68a
commit
71d42bb44b
|
@ -23,10 +23,8 @@ class Api:
|
|||
app.add_api_route("/v1/txt2img", self.text2imgapi, methods=["POST"])
|
||||
|
||||
def text2imgapi(self, txt2imgreq: StableDiffusionProcessingAPI ):
|
||||
print(txt2imgreq)
|
||||
p = StableDiffusionProcessingTxt2Img(**vars(txt2imgreq))
|
||||
p.sd_model = shared.sd_model
|
||||
print(p)
|
||||
processed = process_images(p)
|
||||
|
||||
b64images = []
|
||||
|
@ -35,13 +33,6 @@ class Api:
|
|||
i.save(buffer, format="png")
|
||||
b64images.append(base64.b64encode(buffer.getvalue()))
|
||||
|
||||
response = {
|
||||
"images": b64images,
|
||||
"info": processed.js(),
|
||||
"parameters": json.dumps(vars(txt2imgreq))
|
||||
}
|
||||
|
||||
|
||||
return TextToImageResponse(images=b64images, parameters=json.dumps(vars(txt2imgreq)), info=json.dumps(processed.info))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user