Yw22 commited on
Commit
be61342
1 Parent(s): de71482
Files changed (2) hide show
  1. app.py +21 -7
  2. modules/unet.py +2 -2
app.py CHANGED
@@ -82,14 +82,28 @@ If you have any questions, please feel free to reach me out at <b>ywl@stu.pku.ed
82
 
83
  os.makedirs("models/personalized")
84
  os.makedirs("models/sd1-5")
85
- os.system(f'wget https://huggingface.co/TencentARC/ImageConductor/blob/main/flow_controlnet.ckpt -P models/')
86
- os.system(f'wget https://huggingface.co/TencentARC/ImageConductor/blob/main/image_controlnet.ckpt -P models/')
87
- os.system(f'wget https://huggingface.co/TencentARC/ImageConductor/blob/main/unet.ckpt -P models/')
88
- os.system(f'wget https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/unet/config.json -P models/sd1-5/')
89
- os.system(f'wget https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/unet/diffusion_pytorch_model.bin -P models/sd1-5/')
90
- os.system(f'wget https://huggingface.co/TencentARC/ImageConductor/blob/main/helloobjects_V12c.safetensors -P models/personalized')
91
- os.system(f'wget https://huggingface.co/TencentARC/ImageConductor/blob/main/TUSUN.safetensors -P models/personalized')
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
 
95
 
 
82
 
83
  os.makedirs("models/personalized")
84
  os.makedirs("models/sd1-5")
85
+ os.system(f'wget https://huggingface.co/TencentARC/ImageConductor/resolve/main/flow_controlnet.ckpt?download=true -P models/')
86
+ os.system(f'mv models/flow_controlnet.ckpt?download=true models/flow_controlnet.ckpt')
 
 
 
 
 
87
 
88
+ os.system(f'wget https://huggingface.co/TencentARC/ImageConductor/resolve/main/image_controlnet.ckpt?download=true -P models/')
89
+ os.system(f'mv models/image_controlnet.ckpt?download=true models/image_controlnet.ckpt')
90
+
91
+ os.system(f'wget https://huggingface.co/TencentARC/ImageConductor/resolve/main/unet.ckpt?download=true -P models/')
92
+ os.system(f'mv models/unet.ckpt?download=true models/unet.ckpt')
93
+
94
+
95
+ os.system(f'wget https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/unet/config.json?download=true -P models/sd1-5/')
96
+ os.system(f'mv models/sd1-5/config.json?download=true models/sd1-5/config.json')
97
+
98
+ os.system(f'cp -r models/unet.ckpt models/sd1-5/unet.ckpt')
99
+
100
+ # os.system(f'wget https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/unet/diffusion_pytorch_model.bin?download=true -P models/sd1-5/')
101
+
102
+ os.system(f'wget https://huggingface.co/TencentARC/ImageConductor/resolve/main/helloobjects_V12c.safetensors?download=true -P models/personalized')
103
+ os.system(f'mv models/personalized/helloobjects_V12c.safetensors?download=true models/personalized/helloobjects_V12c.safetensors')
104
+
105
+ os.system(f'wget https://huggingface.co/TencentARC/ImageConductor/resolve/main/TUSUN.safetensors?download=true -P models/personalized')
106
+ os.system(f'mv models/personalized/TUSUN.safetensors?download=true models/personalized/TUSUN.safetensors')
107
 
108
 
109
 
modules/unet.py CHANGED
@@ -565,9 +565,9 @@ class UNet3DConditionFlowModel(ModelMixin, ConfigMixin, UNet2DConditionLoadersMi
565
  "CrossAttnUpBlock3D"
566
  ]
567
 
568
- from diffusers.utils import WEIGHTS_NAME
569
  model = cls.from_config(config, **unet_additional_kwargs)
570
- model_file = os.path.join(pretrained_model_path, WEIGHTS_NAME)
571
  if not os.path.isfile(model_file):
572
  raise RuntimeError(f"{model_file} does not exist")
573
  state_dict = torch.load(model_file, map_location="cpu")
 
565
  "CrossAttnUpBlock3D"
566
  ]
567
 
568
+ # from diffusers.utils import WEIGHTS_NAME
569
  model = cls.from_config(config, **unet_additional_kwargs)
570
+ model_file = os.path.join(pretrained_model_path, "unet.ckpt")
571
  if not os.path.isfile(model_file):
572
  raise RuntimeError(f"{model_file} does not exist")
573
  state_dict = torch.load(model_file, map_location="cpu")