Spaces:
Configuration error
Configuration error
Update ai_design_generator/app.py
Browse files
ai_design_generator/app.py
CHANGED
@@ -12,7 +12,9 @@ prompt = st.text_input("Prompt", "modern minimalist packaging with red and white
|
|
12 |
if st.button("Generate Design"):
|
13 |
with st.spinner("Generating..."):
|
14 |
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-2"
|
15 |
-
|
|
|
|
|
16 |
|
17 |
payload = {"inputs": prompt}
|
18 |
response = requests.post(API_URL, headers=headers, json=payload)
|
|
|
12 |
if st.button("Generate Design"):
|
13 |
with st.spinner("Generating..."):
|
14 |
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-2"
|
15 |
+
import os
|
16 |
+
headers = {"Authorization": f"Bearer {os.environ['HF_TOKEN']}"}
|
17 |
+
|
18 |
|
19 |
payload = {"inputs": prompt}
|
20 |
response = requests.post(API_URL, headers=headers, json=payload)
|