Spaces:
Running
on
Zero
Running
on
Zero
Artiprocher
commited on
Commit
•
8601520
1
Parent(s):
80985dc
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
import spaces
|
2 |
import os
|
3 |
os.system("pip install -r requirements.txt")
|
|
|
|
|
4 |
from diffsynth import download_models
|
5 |
download_models(["Kolors", "FLUX.1-dev"], downloading_priority=["HuggingFace", "ModelScope"])
|
6 |
|
@@ -209,7 +211,7 @@ with gr.Blocks() as app:
|
|
209 |
outputs=[output_image],
|
210 |
triggers=run_button.click
|
211 |
)
|
212 |
-
@spaces.GPU
|
213 |
def generate_image(model_type, model_path, prompt, negative_prompt, cfg_scale, embedded_guidance, num_inference_steps, height, width, seed, *args, progress=gr.Progress()):
|
214 |
_, pipe = load_model(model_type, model_path)
|
215 |
input_params = {
|
|
|
1 |
import spaces
|
2 |
import os
|
3 |
os.system("pip install -r requirements.txt")
|
4 |
+
from huggingface_hub import login
|
5 |
+
login(token=os.getenv('HF_AK'))
|
6 |
from diffsynth import download_models
|
7 |
download_models(["Kolors", "FLUX.1-dev"], downloading_priority=["HuggingFace", "ModelScope"])
|
8 |
|
|
|
211 |
outputs=[output_image],
|
212 |
triggers=run_button.click
|
213 |
)
|
214 |
+
@spaces.GPU(duration=60)
|
215 |
def generate_image(model_type, model_path, prompt, negative_prompt, cfg_scale, embedded_guidance, num_inference_steps, height, width, seed, *args, progress=gr.Progress()):
|
216 |
_, pipe = load_model(model_type, model_path)
|
217 |
input_params = {
|