Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -26,16 +26,5 @@ async def generate_response(request_body: RequestBody):
|
|
26 |
pattern = r'https?://\S+\.(?:jpg|jpeg|png|gif)'
|
27 |
match2 = re.search(pattern, decoded_string)
|
28 |
all_chunk = match2.group()
|
29 |
-
|
30 |
-
if model == 'giz':
|
31 |
-
json_data = {'username': 'm.ar.if.o.l.wr.a@gmail.com','password': 'm28.G/wX>\"fd=sDN'}
|
32 |
-
response = requests.post('https://app.giz.ai/api/signIn', json=json_data, timeout=100)
|
33 |
-
accessToken = response.json()['accessToken']
|
34 |
-
refreshToken = response.json()['refreshToken']
|
35 |
-
headers = {'Accept': 'application/json, text/plain, */*','Accept-Language': 'en-US,en;q=0.9','Cache-Control': 'no-cache','Connection': 'keep-alive','Content-Type': 'application/json','Origin': 'https://app.giz.ai','Pragma': 'no-cache','Sec-Fetch-Dest': 'empty','Sec-Fetch-Mode': 'cors','Sec-Fetch-Site': 'same-origin','User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36','sec-ch-ua': '"Not?A_Brand";v="99", "Chromium";v="130"','sec-ch-ua-mobile': '?0','sec-ch-ua-platform': '"Linux"'}
|
36 |
-
data = {"model":"image-generation","baseModel":"flux1","input":{"settings":{"character":"AI","responseMode":"text","voice":"tts-1:onyx","ttsSpeed":"1","imageModel":"sdxl"},"baseModel":"flux1","width":"1024","height":"1024","batch_size":"1","style":"undefined","checkpoint":"shuttle-3-diffusion-fp8.safetensors","steps":4,"growMask":30,"face_detailer":False,"upscale":False,"mode":"image-generation","prompt":"cat with text 'I LOVE MY HOUSE'"}}
|
37 |
-
cookies = {'accessToken': accessToken,'refreshToken': refreshToken}
|
38 |
-
response = requests.post('https://app.giz.ai/api/data/users/inferenceServer.infer', cookies=cookies, headers=headers, data=json.dumps(data), timeout=100)
|
39 |
-
all_chunk = response.json()['output'][0]
|
40 |
|
41 |
return {"response": all_chunk}
|
|
|
26 |
pattern = r'https?://\S+\.(?:jpg|jpeg|png|gif)'
|
27 |
match2 = re.search(pattern, decoded_string)
|
28 |
all_chunk = match2.group()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
return {"response": all_chunk}
|