Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
a9ea043
1
Parent(s):
e302cfe
Explicitly set gradio tmp path
Browse files
app.py
CHANGED
@@ -57,6 +57,7 @@ args = parser.parse_args()
|
|
57 |
from huggingface_hub import snapshot_download
|
58 |
large_files = ["models/*", "models/**/*"]
|
59 |
snapshot_download(repo_id="adaface-neurips/adaface-models", repo_type="model", allow_patterns=large_files, local_dir=".")
|
|
|
60 |
|
61 |
model_style_type2base_model_path = {
|
62 |
"realistic": "models/rv51/realisticVisionV51_v51VAE_dste8.safetensors",
|
@@ -316,6 +317,7 @@ with gr.Blocks(css=css, theme=gr.themes.Origin()) as demo:
|
|
316 |
file_types=["image"],
|
317 |
file_count="multiple"
|
318 |
)
|
|
|
319 |
# When files are uploaded, show the images in the gallery and hide the file uploader.
|
320 |
uploaded_files_gallery = gr.Gallery(label="Subject images", visible=False, columns=3, rows=1, height=300)
|
321 |
with gr.Column(visible=False) as clear_button_column:
|
@@ -328,7 +330,7 @@ with gr.Blocks(css=css, theme=gr.themes.Origin()) as demo:
|
|
328 |
file_types=["image"],
|
329 |
file_count="multiple"
|
330 |
)
|
331 |
-
|
332 |
uploaded_files_gallery2 = gr.Gallery(label="2nd Subject images (optional)", visible=False, columns=3, rows=1, height=300)
|
333 |
with gr.Column(visible=False) as clear_button_column2:
|
334 |
remove_and_reupload2 = gr.ClearButton(value="Remove and upload 2nd Subject images",
|
|
|
57 |
from huggingface_hub import snapshot_download
|
58 |
large_files = ["models/*", "models/**/*"]
|
59 |
snapshot_download(repo_id="adaface-neurips/adaface-models", repo_type="model", allow_patterns=large_files, local_dir=".")
|
60 |
+
os.makedirs("/tmp/gradio", exist_ok=True)
|
61 |
|
62 |
model_style_type2base_model_path = {
|
63 |
"realistic": "models/rv51/realisticVisionV51_v51VAE_dste8.safetensors",
|
|
|
317 |
file_types=["image"],
|
318 |
file_count="multiple"
|
319 |
)
|
320 |
+
img_files.GRADIO_CACHE = "/tmp/gradio"
|
321 |
# When files are uploaded, show the images in the gallery and hide the file uploader.
|
322 |
uploaded_files_gallery = gr.Gallery(label="Subject images", visible=False, columns=3, rows=1, height=300)
|
323 |
with gr.Column(visible=False) as clear_button_column:
|
|
|
330 |
file_types=["image"],
|
331 |
file_count="multiple"
|
332 |
)
|
333 |
+
img_files2.GRADIO_CACHE = "/tmp/gradio"
|
334 |
uploaded_files_gallery2 = gr.Gallery(label="2nd Subject images (optional)", visible=False, columns=3, rows=1, height=300)
|
335 |
with gr.Column(visible=False) as clear_button_column2:
|
336 |
remove_and_reupload2 = gr.ClearButton(value="Remove and upload 2nd Subject images",
|