Update app.py
Browse files
app.py
CHANGED
|
@@ -43,6 +43,20 @@ with open ("./MuseV/configs/model/T2I_all_model.py","r+") as scrip:
|
|
| 43 |
scrip.truncate()
|
| 44 |
scrip.seek(0)
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
@spaces.GPU
|
| 47 |
def run(duration=180):
|
| 48 |
subprocess.run(["python", "./MuseV/text2video.py", "--sd_model_name", "majicmixRealv6Fp16", "--unet_model_name", "musev", "-test_data_path", "./MuseV/configs/tasks/example.yaml", "--n_batch", "1", "--target_datas", "yongen", "--vae_model_path", "./MuseV/checkpoints/vae/sd-vae-ft-mse", "--time_size", "12", "--fps", "12"])
|
|
@@ -50,7 +64,9 @@ def run(duration=180):
|
|
| 50 |
return "./output.mp4"
|
| 51 |
|
| 52 |
with gr.Blocks() as demo:
|
| 53 |
-
|
|
|
|
|
|
|
| 54 |
video = gr.Video()
|
| 55 |
button.click(fn=run,outputs=video)
|
| 56 |
|
|
|
|
| 43 |
scrip.truncate()
|
| 44 |
scrip.seek(0)
|
| 45 |
|
| 46 |
+
def add_new_image(image):
|
| 47 |
+
img_settings = """- condition_images: ./MuseV/data/images/yongen.jpeg
|
| 48 |
+
eye_blinks_factor: 1.8
|
| 49 |
+
height: 1308
|
| 50 |
+
img_length_ratio: 0.957
|
| 51 |
+
ipadapter_image: ${.condition_images}
|
| 52 |
+
name: yongen
|
| 53 |
+
prompt: (masterpiece, best quality, highres:1),(1boy, solo:1),(eye blinks:1.8),(head wave:1.3)
|
| 54 |
+
refer_image: ${.condition_images}
|
| 55 |
+
video_path: null
|
| 56 |
+
width: 736"""
|
| 57 |
+
with open ("./MuseV/configs/tasks/run.yaml","r+") as configs:
|
| 58 |
+
configs.write(img_settings)
|
| 59 |
+
|
| 60 |
@spaces.GPU
|
| 61 |
def run(duration=180):
|
| 62 |
subprocess.run(["python", "./MuseV/text2video.py", "--sd_model_name", "majicmixRealv6Fp16", "--unet_model_name", "musev", "-test_data_path", "./MuseV/configs/tasks/example.yaml", "--n_batch", "1", "--target_datas", "yongen", "--vae_model_path", "./MuseV/checkpoints/vae/sd-vae-ft-mse", "--time_size", "12", "--fps", "12"])
|
|
|
|
| 64 |
return "./output.mp4"
|
| 65 |
|
| 66 |
with gr.Blocks() as demo:
|
| 67 |
+
image = gr.Image()
|
| 68 |
+
image.change(fn=add_new_image,inputs=image)
|
| 69 |
+
button = gr.Button(label="Generate Video")
|
| 70 |
video = gr.Video()
|
| 71 |
button.click(fn=run,outputs=video)
|
| 72 |
|