Update app.py
All checks were successful
society-ai-hub-container-cache Actions Demo / build (push) Successful in 59s
All checks were successful
society-ai-hub-container-cache Actions Demo / build (push) Successful in 59s
This commit is contained in:
parent
601f0a2bfa
commit
513d8342d5
7
app.py
7
app.py
@ -5,8 +5,10 @@ from PIL import Image
|
|||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import random
|
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_SEED = np.iinfo(np.int32).max
|
||||||
MAX_IMAGE_SIZE = 2048
|
MAX_IMAGE_SIZE = 2048
|
||||||
|
|
||||||
@ -107,7 +109,8 @@ with gr.Blocks(css="footer {visibility: hidden}") as demo:
|
|||||||
}
|
}
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json",
|
||||||
|
"Authorization": f"Bearer {API_TOKEN}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Send the POST request
|
# Send the POST request
|
||||||
|
Loading…
x
Reference in New Issue
Block a user