Spaces:
Running
Running
JV A
commited on
Commit
·
d35c749
1
Parent(s):
da1b766
Update app.py
Browse files
app.py
CHANGED
@@ -3,15 +3,15 @@ import requests
|
|
3 |
import json
|
4 |
import PIL.Image
|
5 |
from io import BytesIO
|
6 |
-
|
7 |
def generate_image(prompt):
|
8 |
# Define the API endpoint
|
9 |
-
apiUrl =
|
10 |
-
|
11 |
# Define the request headers
|
12 |
headers = {
|
13 |
"Content-Type": "application/json",
|
14 |
-
"token": "
|
15 |
}
|
16 |
|
17 |
# Define the request body
|
|
|
3 |
import json
|
4 |
import PIL.Image
|
5 |
from io import BytesIO
|
6 |
+
import os
|
7 |
def generate_image(prompt):
|
8 |
# Define the API endpoint
|
9 |
+
apiUrl = os.getenv("API_URL")
|
10 |
+
token = os.getenv("API_TOKEN")
|
11 |
# Define the request headers
|
12 |
headers = {
|
13 |
"Content-Type": "application/json",
|
14 |
+
"token": "token"
|
15 |
}
|
16 |
|
17 |
# Define the request body
|