Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -30,7 +30,7 @@ def get_seed(randomize_seed: bool, seed: int) -> int:
|
|
30 |
# The function for our Gradio app #
|
31 |
#####################################
|
32 |
@spaces.GPU(duration=120)
|
33 |
-
def generate(prompt, input_image, seed
|
34 |
"""
|
35 |
Runs the Flux Control pipeline for editing the given `input_image`
|
36 |
with the specified `prompt`. The pipeline is on GPU by default.
|
@@ -38,6 +38,9 @@ def generate(prompt, input_image, seed, progress=gr.Progress(track_tqdm=True)):
|
|
38 |
seed = int(seed) # Ensure seed is an integer
|
39 |
generator = torch.Generator(device="cuda").manual_seed(seed) # Maintain reproducibility
|
40 |
|
|
|
|
|
|
|
41 |
with progress.tqdm(total=1, desc="Generating Image") as pbar:
|
42 |
output_image = pipeline(
|
43 |
control_image=input_image,
|
@@ -115,4 +118,4 @@ def launch_app():
|
|
115 |
|
116 |
if __name__ == "__main__":
|
117 |
demo = launch_app()
|
118 |
-
demo.launch()
|
|
|
30 |
# The function for our Gradio app #
|
31 |
#####################################
|
32 |
@spaces.GPU(duration=120)
|
33 |
+
def generate(prompt, input_image, seed):
|
34 |
"""
|
35 |
Runs the Flux Control pipeline for editing the given `input_image`
|
36 |
with the specified `prompt`. The pipeline is on GPU by default.
|
|
|
38 |
seed = int(seed) # Ensure seed is an integer
|
39 |
generator = torch.Generator(device="cuda").manual_seed(seed) # Maintain reproducibility
|
40 |
|
41 |
+
# Create a progress bar manually
|
42 |
+
progress = gr.Progress(track_tqdm=True)
|
43 |
+
|
44 |
with progress.tqdm(total=1, desc="Generating Image") as pbar:
|
45 |
output_image = pipeline(
|
46 |
control_image=input_image,
|
|
|
118 |
|
119 |
if __name__ == "__main__":
|
120 |
demo = launch_app()
|
121 |
+
demo.launch()
|