wondervictor commited on
Commit
66ffc69
·
1 Parent(s): 1925277

add requirements

Browse files
app.py CHANGED
@@ -6,12 +6,12 @@ from app_canny import create_demo as create_demo_canny
6
  from app_depth import create_demo as create_demo_depth
7
  import os
8
 
9
- hf_hub_download('wondervictor/ControlAR',
10
  filename='canny_MR.safetensors',
11
- cache_dir='./checkpoints/')
12
- hf_hub_download('wondervictor/ControlAR',
13
  filename='depth_MR.safetensors',
14
- cache_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)."
@@ -32,4 +32,4 @@ with gr.Blocks(css="style.css") as demo:
32
  create_demo_canny(model.process_canny)
33
 
34
  if __name__ == "__main__":
35
- demo.queue().launch(share=False, server_name="0.0.0.0")
 
6
  from app_depth import create_demo as create_demo_depth
7
  import os
8
 
9
+ hf_hub_download(repo_id='wondervictor/ControlAR',
10
  filename='canny_MR.safetensors',
11
+ local_dir='./checkpoints/')
12
+ hf_hub_download(repo_id='wondervictor/ControlAR',
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)."
 
32
  create_demo_canny(model.process_canny)
33
 
34
  if __name__ == "__main__":
35
+ demo.launch(share=False)
autoregressive/models/dinov2_adapter.py CHANGED
@@ -10,7 +10,7 @@ class Dinov2_Adapter(nn.Module):
10
  super(Dinov2_Adapter, self).__init__()
11
  print(f"Choose adapter size: {adapter_size}")
12
  print(f"condition type: {condition_type}")
13
- self.model = AutoModel.from_pretrained(f'autoregressive/models/dinov2-{adapter_size}')
14
  self.condition_type = condition_type
15
 
16
  def to_patch14(self, input):
 
10
  super(Dinov2_Adapter, self).__init__()
11
  print(f"Choose adapter size: {adapter_size}")
12
  print(f"condition type: {condition_type}")
13
+ self.model = AutoModel.from_pretrained(f'facebook/dinov2-{adapter_size}')
14
  self.condition_type = condition_type
15
 
16
  def to_patch14(self, input):
model.py CHANGED
@@ -14,8 +14,8 @@ from autoregressive.models.generate import generate
14
  from condition.midas.depth import MidasDetector
15
 
16
  models = {
17
- "canny": "checkpoints/t2i/canny_MR.safetensors",
18
- "depth": "checkpoints/t2i/depth_MR.safetensors",
19
  }
20
 
21
 
 
14
  from condition.midas.depth import MidasDetector
15
 
16
  models = {
17
+ "canny": "checkpoints/canny_MR.safetensors",
18
+ "depth": "checkpoints/depth_MR.safetensors",
19
  }
20
 
21
 
requirements.txt CHANGED
@@ -18,4 +18,5 @@ clean-fid
18
  safetensors
19
  transformers
20
  tiktoken
21
- sentencepiece
 
 
18
  safetensors
19
  transformers
20
  tiktoken
21
+ sentencepiece
22
+ basicsr