Update main.py
Browse files
main.py
CHANGED
|
@@ -21,7 +21,7 @@ API_TOKEN = os.getenv("HF_READ_TOKEN") # it is free
|
|
| 21 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
| 22 |
def generate_image(prompt):
|
| 23 |
try:
|
| 24 |
-
payload = {"inputs": prompt}
|
| 25 |
response = requests.post(API_URL, headers=headers, json=payload)
|
| 26 |
response.raise_for_status() # Raise an exception for HTTP errors
|
| 27 |
image_bytes = response.content
|
|
|
|
| 21 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
| 22 |
def generate_image(prompt):
|
| 23 |
try:
|
| 24 |
+
payload = {"inputs": prompt,noise_level}
|
| 25 |
response = requests.post(API_URL, headers=headers, json=payload)
|
| 26 |
response.raise_for_status() # Raise an exception for HTTP errors
|
| 27 |
image_bytes = response.content
|