Skip to content

Commit

Permalink
testicles
Browse files Browse the repository at this point in the history
  • Loading branch information
Styp committed Sep 17, 2022
1 parent 2c2b252 commit af78eac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ def root():


@app.post("/imageFromPromt")
def image_from_promt(payload):
def image_from_promt(payload: PromptPayload):
consumer = StableDiffusionConsumer()
image_bytes = consumer.fetch_image(payload.prompt)

return StreamingResponse(consumer.parse_to_bytesio(image_bytes), media_type="image/png")

@app.post("/base64FromPrompt")
def base64_from_prompt(payload):
def base64_from_prompt(payload: PromptPayload):
consumer = StableDiffusionConsumer()
img_json = {
"image": consumer.fetch_image(payload.prompt)
Expand All @@ -44,7 +44,7 @@ def base64_from_prompt(payload):
return JSONResponse(content=img_json)

@app.post("/promptsFromText")
def prompts_from_text(text_payload):
def prompts_from_text(text_payload: TextPayload):
prompt_extractor = PromptExtractor()

prompts = prompt_extractor.extract_paragraphs_with_prompts(text_payload.text)
Expand Down

0 comments on commit af78eac

Please sign in to comment.