Update app.py
Browse files
app.py
CHANGED
@@ -46,24 +46,28 @@ with open ("./MuseV/configs/model/T2I_all_model.py","r+") as scrip:
|
|
46 |
from PIL import Image
|
47 |
|
48 |
def add_new_image(image):
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
52 |
eye_blinks_factor: 1.8
|
53 |
-
height:
|
54 |
-
img_length_ratio:
|
55 |
-
ipadapter_image:
|
56 |
-
name:
|
57 |
-
prompt: (masterpiece, best quality, highres:1),(
|
58 |
-
refer_image:
|
59 |
video_path: null
|
60 |
-
width:
|
61 |
with open ("./MuseV/configs/tasks/run.yaml","r+") as configs:
|
62 |
configs.write(img_settings)
|
63 |
|
64 |
@spaces.GPU
|
65 |
def run(duration=180):
|
66 |
-
subprocess.run(["python", "./MuseV/text2video.py", "--sd_model_name", "majicmixRealv6Fp16", "--unet_model_name", "musev", "-test_data_path", "./MuseV/configs/tasks/
|
67 |
#subprocess.run(["python", "./MuseV/text2video.py", "--sd_model_name", "majicmixRealv6Fp16", "--unet_model_name", "musev_referencenet", "--referencenet_model_name", "musev_referencenet", "--ip_adapter_model_name", "musev_referencenet", "-test_data_path", "./MuseV/configs/tasks/example.yaml", "--output_dir", "./MuseV", "--n_batch", "1", "--target_datas", "jinkesi2", "--vision_clip_extractor_class_name", "ImageClipVisionFeatureExtractor", "--vision_clip_model_path", "./MuseV/checkpoints/IP-Adapter/models/image_encoder", "--motion_speed", "5.0", "--vae_model_path", "./MuseV/checkpoints/vae/sd-vae-ft-mse", "--time_size", "120", "--fps", "24"])
|
68 |
return "./output.mp4"
|
69 |
|
|
|
46 |
from PIL import Image
|
47 |
|
48 |
def add_new_image(image):
|
49 |
+
image = Image.fromarray(image)
|
50 |
+
height = image.height
|
51 |
+
width = image.width
|
52 |
+
lr = width/height
|
53 |
+
ip_img = "${.condition_images}"
|
54 |
+
image.save("./img.png")
|
55 |
+
img_settings = f"""- condition_images: ./img.png
|
56 |
eye_blinks_factor: 1.8
|
57 |
+
height: {height}
|
58 |
+
img_length_ratio: {lr}
|
59 |
+
ipadapter_image: {ip_img}
|
60 |
+
name: image
|
61 |
+
prompt: (masterpiece, best quality, highres:1),(1person, solo:1),(eye blinks:1.8),(head wave:1.3)
|
62 |
+
refer_image: {ip_img}
|
63 |
video_path: null
|
64 |
+
width: width"""
|
65 |
with open ("./MuseV/configs/tasks/run.yaml","r+") as configs:
|
66 |
configs.write(img_settings)
|
67 |
|
68 |
@spaces.GPU
|
69 |
def run(duration=180):
|
70 |
+
subprocess.run(["python", "./MuseV/text2video.py", "--sd_model_name", "majicmixRealv6Fp16", "--unet_model_name", "musev", "-test_data_path", "./MuseV/configs/tasks/run.yaml", "--n_batch", "1", "--target_datas", "image", "--vae_model_path", "./MuseV/checkpoints/vae/sd-vae-ft-mse", "--time_size", "12", "--fps", "12"])
|
71 |
#subprocess.run(["python", "./MuseV/text2video.py", "--sd_model_name", "majicmixRealv6Fp16", "--unet_model_name", "musev_referencenet", "--referencenet_model_name", "musev_referencenet", "--ip_adapter_model_name", "musev_referencenet", "-test_data_path", "./MuseV/configs/tasks/example.yaml", "--output_dir", "./MuseV", "--n_batch", "1", "--target_datas", "jinkesi2", "--vision_clip_extractor_class_name", "ImageClipVisionFeatureExtractor", "--vision_clip_model_path", "./MuseV/checkpoints/IP-Adapter/models/image_encoder", "--motion_speed", "5.0", "--vae_model_path", "./MuseV/checkpoints/vae/sd-vae-ft-mse", "--time_size", "120", "--fps", "24"])
|
72 |
return "./output.mp4"
|
73 |
|