Update app.py
Browse files
app.py
CHANGED
|
@@ -24,7 +24,7 @@ headers = {"Authorization": f"Bearer {API_TOKEN}"} if API_TOKEN else {}
|
|
| 24 |
timeout = 100 # seconds for API call timeout
|
| 25 |
|
| 26 |
IMAGE_DIR = "temp_generated_images" # Directory to store temporary images
|
| 27 |
-
|
| 28 |
|
| 29 |
# --- Ensure temporary directory exists ---
|
| 30 |
try:
|
|
@@ -136,13 +136,13 @@ def query(prompt, negative_prompt, steps=4, cfg_scale=0, seed=-1, width=1024, he
|
|
| 136 |
|
| 137 |
encoded_file_url = quote(relative_file_url)
|
| 138 |
# Add space_name parameter to the URL
|
| 139 |
-
|
| 140 |
-
print(f"{
|
| 141 |
|
| 142 |
# Use simpler button style like the Run button
|
| 143 |
download_html = (
|
| 144 |
f'<div style="text-align: center;">'
|
| 145 |
-
f'<a href="{
|
| 146 |
f'Download Image'
|
| 147 |
f'</a>'
|
| 148 |
f'</div>'
|
|
|
|
| 24 |
timeout = 100 # seconds for API call timeout
|
| 25 |
|
| 26 |
IMAGE_DIR = "temp_generated_images" # Directory to store temporary images
|
| 27 |
+
ARINTELI_REDIRECT_BASE = "https://arinteli.com/app/" # Your redirector URL
|
| 28 |
|
| 29 |
# --- Ensure temporary directory exists ---
|
| 30 |
try:
|
|
|
|
| 136 |
|
| 137 |
encoded_file_url = quote(relative_file_url)
|
| 138 |
# Add space_name parameter to the URL
|
| 139 |
+
arinteli_url = f"{ARINTELI_REDIRECT_BASE}?download_url={encoded_file_url}&space_name={space_name}"
|
| 140 |
+
print(f"{arinteli_url}")
|
| 141 |
|
| 142 |
# Use simpler button style like the Run button
|
| 143 |
download_html = (
|
| 144 |
f'<div style="text-align: center;">'
|
| 145 |
+
f'<a href="{arinteli_url}" target="_blank" class="gr-button gr-button-lg gr-button-primary">'
|
| 146 |
f'Download Image'
|
| 147 |
f'</a>'
|
| 148 |
f'</div>'
|