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