Spaces:
Running
on
Zero
Running
on
Zero
added flux
Browse files- check_app.py +8 -0
check_app.py
CHANGED
@@ -15,6 +15,11 @@ import gradio as gr
|
|
15 |
cache_dir = '/workspace/hf_cache'
|
16 |
|
17 |
MODEL_CONFIGS = {
|
|
|
|
|
|
|
|
|
|
|
18 |
"AuraFlow": {
|
19 |
"repo_id": "fal/AuraFlow",
|
20 |
"pipeline_class": AuraFlowPipeline,
|
@@ -45,6 +50,7 @@ def generate_image_with_progress(pipe, prompt, num_steps, guidance_scale=None, s
|
|
45 |
image = pipe(
|
46 |
prompt,
|
47 |
num_inference_steps=num_steps,
|
|
|
48 |
guidance_scale=guidance_scale,
|
49 |
callback_on_step_end=callback,
|
50 |
).images[0]
|
@@ -54,6 +60,7 @@ def generate_image_with_progress(pipe, prompt, num_steps, guidance_scale=None, s
|
|
54 |
prompt,
|
55 |
num_inference_steps=num_steps,
|
56 |
guidance_scale=guidance_scale,
|
|
|
57 |
).images[0]
|
58 |
elif hasattr(pipe, "callback_on_step_end") and not hasattr(pipe, "guidance_scale"):
|
59 |
print(" has callback_on_step_end and NO guidance_scale")
|
@@ -68,6 +75,7 @@ def generate_image_with_progress(pipe, prompt, num_steps, guidance_scale=None, s
|
|
68 |
image = pipe(
|
69 |
prompt,
|
70 |
num_inference_steps=num_steps,
|
|
|
71 |
).images[0]
|
72 |
|
73 |
return image
|
|
|
15 |
cache_dir = '/workspace/hf_cache'
|
16 |
|
17 |
MODEL_CONFIGS = {
|
18 |
+
"FLUX": {
|
19 |
+
"repo_id": "black-forest-labs/FLUX.1-dev",
|
20 |
+
"pipeline_class": FluxPipeline,
|
21 |
+
"cache_dir" : cache_dir
|
22 |
+
},
|
23 |
"AuraFlow": {
|
24 |
"repo_id": "fal/AuraFlow",
|
25 |
"pipeline_class": AuraFlowPipeline,
|
|
|
50 |
image = pipe(
|
51 |
prompt,
|
52 |
num_inference_steps=num_steps,
|
53 |
+
generator=generator,
|
54 |
guidance_scale=guidance_scale,
|
55 |
callback_on_step_end=callback,
|
56 |
).images[0]
|
|
|
60 |
prompt,
|
61 |
num_inference_steps=num_steps,
|
62 |
guidance_scale=guidance_scale,
|
63 |
+
generator=generator,
|
64 |
).images[0]
|
65 |
elif hasattr(pipe, "callback_on_step_end") and not hasattr(pipe, "guidance_scale"):
|
66 |
print(" has callback_on_step_end and NO guidance_scale")
|
|
|
75 |
image = pipe(
|
76 |
prompt,
|
77 |
num_inference_steps=num_steps,
|
78 |
+
generator=generator,
|
79 |
).images[0]
|
80 |
|
81 |
return image
|