Spaces:
Running
on
Zero
Running
on
Zero
wondervictor
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -13,6 +13,21 @@ import os
|
|
13 |
# filename='depth_MR.safetensors',
|
14 |
# local_dir='./checkpoints/')
|
15 |
# # hf_hub_download('google/flan-t5-xl', cache_dir='./checkpoints/')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
DESCRIPTION = "# [ControlAR: Controllable Image Generation with Autoregressive Models](https://arxiv.org/abs/2410.02705) \n ### The first row in outputs is the input image and condition. The second row is the images generated by ControlAR. \n ### You can run locally by following the instruction on our [Github Repo](https://github.com/hustvl/ControlAR)."
|
18 |
SHOW_DUPLICATE_BUTTON = os.getenv("SHOW_DUPLICATE_BUTTON") == "1"
|
@@ -33,18 +48,4 @@ with gr.Blocks(css="style.css") as demo:
|
|
33 |
create_demo_canny(model.process_canny)
|
34 |
|
35 |
if __name__ == "__main__":
|
36 |
-
ckpt_folder = './checkpoints'
|
37 |
-
t5_folder = os.path.join(ckpt_folder, "flan-t5-xl/flan-t5-xl")
|
38 |
-
hf_hub_download(repo_id="google/flan-t5-xl", filename="config.json", local_dir=t5_folder)
|
39 |
-
hf_hub_download(repo_id="google/flan-t5-xl", filename="pytorch_model-00001-of-00002.bin", local_dir=t5_folder)
|
40 |
-
hf_hub_download(repo_id="google/flan-t5-xl", filename="pytorch_model-00002-of-00002.bin", local_dir=t5_folder)
|
41 |
-
hf_hub_download(repo_id="google/flan-t5-xl", filename="pytorch_model.bin.index.json", local_dir=t5_folder)
|
42 |
-
hf_hub_download(repo_id="google/flan-t5-xl", filename="special_tokens_map.json", local_dir=t5_folder)
|
43 |
-
hf_hub_download(repo_id="google/flan-t5-xl", filename="spiece.model", local_dir=t5_folder)
|
44 |
-
hf_hub_download(repo_id="google/flan-t5-xl", filename="tokenizer_config.json", local_dir=t5_folder)
|
45 |
-
|
46 |
-
hf_hub_download(repo_id="lllyasviel/Annotators", filename="dpt_hybrid-midas-501f0c75.pt", local_dir=ckpt_folder)
|
47 |
-
|
48 |
-
hf_hub_download(repo_id="wondervictor/ControlAR", filename="canny_MR.safetensors", local_dir=ckpt_folder)
|
49 |
-
hf_hub_download(repo_id="wondervictor/ControlAR", filename="depth_MR.safetensors", local_dir=ckpt_folder)
|
50 |
demo.launch(share=False)
|
|
|
13 |
# filename='depth_MR.safetensors',
|
14 |
# local_dir='./checkpoints/')
|
15 |
# # hf_hub_download('google/flan-t5-xl', cache_dir='./checkpoints/')
|
16 |
+
ckpt_folder = './checkpoints'
|
17 |
+
t5_folder = os.path.join(ckpt_folder, "flan-t5-xl/flan-t5-xl")
|
18 |
+
hf_hub_download(repo_id="google/flan-t5-xl", filename="config.json", local_dir=t5_folder)
|
19 |
+
hf_hub_download(repo_id="google/flan-t5-xl", filename="pytorch_model-00001-of-00002.bin", local_dir=t5_folder)
|
20 |
+
hf_hub_download(repo_id="google/flan-t5-xl", filename="pytorch_model-00002-of-00002.bin", local_dir=t5_folder)
|
21 |
+
hf_hub_download(repo_id="google/flan-t5-xl", filename="pytorch_model.bin.index.json", local_dir=t5_folder)
|
22 |
+
hf_hub_download(repo_id="google/flan-t5-xl", filename="special_tokens_map.json", local_dir=t5_folder)
|
23 |
+
hf_hub_download(repo_id="google/flan-t5-xl", filename="spiece.model", local_dir=t5_folder)
|
24 |
+
hf_hub_download(repo_id="google/flan-t5-xl", filename="tokenizer_config.json", local_dir=t5_folder)
|
25 |
+
|
26 |
+
hf_hub_download(repo_id="lllyasviel/Annotators", filename="dpt_hybrid-midas-501f0c75.pt", local_dir=ckpt_folder)
|
27 |
+
|
28 |
+
hf_hub_download(repo_id="wondervictor/ControlAR", filename="canny_MR.safetensors", local_dir=ckpt_folder)
|
29 |
+
hf_hub_download(repo_id="wondervictor/ControlAR", filename="depth_MR.safetensors", local_dir=ckpt_folder)
|
30 |
+
|
31 |
|
32 |
DESCRIPTION = "# [ControlAR: Controllable Image Generation with Autoregressive Models](https://arxiv.org/abs/2410.02705) \n ### The first row in outputs is the input image and condition. The second row is the images generated by ControlAR. \n ### You can run locally by following the instruction on our [Github Repo](https://github.com/hustvl/ControlAR)."
|
33 |
SHOW_DUPLICATE_BUTTON = os.getenv("SHOW_DUPLICATE_BUTTON") == "1"
|
|
|
48 |
create_demo_canny(model.process_canny)
|
49 |
|
50 |
if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
demo.launch(share=False)
|