Spaces:
Running
Running
Update app.py
Browse fileschange endpoints
app.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
import random
|
3 |
from gradio_client import Client
|
4 |
import os
|
5 |
from themes import IndonesiaTheme # Impor tema custom dari themes.py
|
6 |
|
7 |
# Constants
|
8 |
-
MAX_SEED =
|
9 |
MAX_IMAGE_SIZE = 2048
|
10 |
DEFAULT_WIDTH = 1024
|
11 |
DEFAULT_HEIGHT = 1024
|
@@ -152,14 +153,16 @@ with gr.Blocks(css=css, theme=IndonesiaTheme()) as RealtimeFluxAPP:
|
|
152 |
fn=generate_image,
|
153 |
inputs=[prompt, seed, width, height, randomize_seed, num_inference_steps],
|
154 |
outputs=[result, seed, latency],
|
155 |
-
show_progress=
|
156 |
)
|
157 |
|
158 |
enhanceBtn.click(
|
159 |
fn=enhance_image,
|
160 |
inputs=[prompt, seed, width, height],
|
161 |
outputs=[result, seed, latency],
|
162 |
-
show_progress=
|
|
|
|
|
163 |
)
|
164 |
|
165 |
# Tambahkan footer di bagian bawah
|
@@ -171,4 +174,4 @@ with gr.Blocks(css=css, theme=IndonesiaTheme()) as RealtimeFluxAPP:
|
|
171 |
|
172 |
# Menjalankan aplikasi
|
173 |
if __name__ == "__main__":
|
174 |
-
RealtimeFluxAPP.
|
|
|
1 |
import gradio as gr
|
2 |
+
import numpy as np
|
3 |
import random
|
4 |
from gradio_client import Client
|
5 |
import os
|
6 |
from themes import IndonesiaTheme # Impor tema custom dari themes.py
|
7 |
|
8 |
# Constants
|
9 |
+
MAX_SEED = np.iinfo(np.int32).max
|
10 |
MAX_IMAGE_SIZE = 2048
|
11 |
DEFAULT_WIDTH = 1024
|
12 |
DEFAULT_HEIGHT = 1024
|
|
|
153 |
fn=generate_image,
|
154 |
inputs=[prompt, seed, width, height, randomize_seed, num_inference_steps],
|
155 |
outputs=[result, seed, latency],
|
156 |
+
show_progress="full",
|
157 |
)
|
158 |
|
159 |
enhanceBtn.click(
|
160 |
fn=enhance_image,
|
161 |
inputs=[prompt, seed, width, height],
|
162 |
outputs=[result, seed, latency],
|
163 |
+
show_progress="hidden",
|
164 |
+
queue=False,
|
165 |
+
concurrency_limit=None
|
166 |
)
|
167 |
|
168 |
# Tambahkan footer di bagian bawah
|
|
|
174 |
|
175 |
# Menjalankan aplikasi
|
176 |
if __name__ == "__main__":
|
177 |
+
RealtimeFluxAPP.launch(show_api=False, show_error=True)
|