coder160 commited on
Commit
fad626e
1 Parent(s): 0c0c275

update txt2img input params

Browse files
Files changed (2) hide show
  1. api/core/app.py +0 -2
  2. api/main.py +1 -3
api/core/app.py CHANGED
@@ -1,11 +1,9 @@
1
  class Demos:
2
  def __init__(self):
3
  from fastapi import FastAPI, HTTPException, Response, File
4
- from typing import Annotated
5
  self.api = FastAPI
6
  self.exception = HTTPException
7
  self.api_response = Response
8
- self.annotated = Annotated
9
  self.fileupload = File
10
  def validate_apikey(self,api_key)->bool:
11
  __validation = True
 
1
  class Demos:
2
  def __init__(self):
3
  from fastapi import FastAPI, HTTPException, Response, File
 
4
  self.api = FastAPI
5
  self.exception = HTTPException
6
  self.api_response = Response
 
7
  self.fileupload = File
8
  def validate_apikey(self,api_key)->bool:
9
  __validation = True
api/main.py CHANGED
@@ -53,10 +53,8 @@ def get_text2speach(data:dict) -> dict:
53
 
54
 
55
 
56
-
57
-
58
  @api.post("/imagen_a_imagen/", status_code=201, responses = {201: {"content": {"image/png": {}}}} ,response_class=__main.api_response)
59
- def get_text2img(data:dict, file: __main.annotated[bytes, __main.fileupload()]):
60
  __response=dict({"request_data":data})
61
  try:
62
  if data and 'texto' in data and 'modelo' in data and file is not None:
 
53
 
54
 
55
 
 
 
56
  @api.post("/imagen_a_imagen/", status_code=201, responses = {201: {"content": {"image/png": {}}}} ,response_class=__main.api_response)
57
+ def get_text2img(data:dict, file: bytes = __main.fileupload()):
58
  __response=dict({"request_data":data})
59
  try:
60
  if data and 'texto' in data and 'modelo' in data and file is not None: