From 513d8342d567abbe977d66ff4e87a7169ad2e039 Mon Sep 17 00:00:00 2001 From: badhezi Date: Wed, 11 Dec 2024 08:34:53 +0000 Subject: [PATCH] Update app.py --- app.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 65f9696..74ca495 100644 --- a/app.py +++ b/app.py @@ -5,8 +5,10 @@ from PIL import Image from io import BytesIO import numpy as np import random +import os -API_URL = 'https://hub.societyai.com/models/flux-1-schnell/infer' +API_URL = 'https://hub.societyai.com/models/flux-1-schnell-test/infer' +API_TOKEN = os.environ.get("SAI_API_TOKEN", "") MAX_SEED = np.iinfo(np.int32).max MAX_IMAGE_SIZE = 2048 @@ -107,7 +109,8 @@ with gr.Blocks(css="footer {visibility: hidden}") as demo: } headers = { - "Content-Type": "application/json" + "Content-Type": "application/json", + "Authorization": f"Bearer {API_TOKEN}" } # Send the POST request