Files
aigc-apps-EasyAnimate/app.py
T
Bubbliiiingandzouxinyi0625 fb0916f4da Update EasyAnimateV2 (#5)
* update EasyAnimateV2

* update datasets loader

* update datasets loader

* update fast api

* complete data preprocess pipeline.

* update lots of readme

* update readme bans

* fix bug in validation while training

* provide example for video cut

* update text box

* add arxiv

* delete IDDPM

* update gallery

* update arxiv

* update readme

* update readme

* link fix

* update vae readme

---------

Co-authored-by: zouxinyi0625 <zouxinyi.zxy@alibaba-inc.com>
2024-05-31 10:33:14 +08:00

38 lines
1.1 KiB
Python

import time
from easyanimate.api.api import infer_forward_api, update_diffusion_transformer_api, update_edition_api
from easyanimate.ui.ui import ui_modelscope, ui
if __name__ == "__main__":
# Choose the ui mode
ui_mode = "normal"
# Server ip
server_name = "0.0.0.0"
server_port = 7860
# Params below is used when ui_mode = "modelscope"
edition = "v2"
config_path = "config/easyanimate_video_magvit_motion_module_v2.yaml"
model_name = "models/Diffusion_Transformer/EasyAnimateV2-XL-2-512x512"
savedir_sample = "samples"
if ui_mode != "modelscope":
demo, controller = ui()
else:
demo, controller = ui_modelscope(edition, config_path, model_name, savedir_sample)
# launch gradio
app, _, _ = demo.queue(status_update_rate=1).launch(
server_name=server_name,
server_port=server_port,
prevent_thread_lock=True
)
# launch api
infer_forward_api(None, app, controller)
update_diffusion_transformer_api(None, app, controller)
update_edition_api(None, app, controller)
# not close the python
while True:
time.sleep(5)