* update train_lora && update deepspeed && update training with max token length * fix bug in train.py * fix bug in training_with_video_token_length * update v2v && update v2v api * add rope2d embedding precomputation; move text encoder to dataloader to reduce gpu memory consumpution * add cuda multi-stream to speedup vae encode * update new vae && new comfyui * fix some bug in training code * Add lcm lora (#89) Co-authored-by: xuanyuan.lb <xuanyuan.lb@alibaba-inc.com> * Update Training Code and fix bug in low vram mode * fix bug in low vram mode * update report * update cfg * actual text clip --------- Co-authored-by: mengli.cml <mengli.cml@alibaba-inc.com> Co-authored-by: liubo0902 <38622806+liubo0902@users.noreply.github.com> Co-authored-by: xuanyuan.lb <xuanyuan.lb@alibaba-inc.com>
48 lines
1.6 KiB
Python
48 lines
1.6 KiB
Python
import time
|
|
import torch
|
|
|
|
from easyanimate.api.api import infer_forward_api, update_diffusion_transformer_api, update_edition_api
|
|
from easyanimate.ui.ui import ui_modelscope, ui_eas, ui
|
|
|
|
if __name__ == "__main__":
|
|
# Choose the ui mode
|
|
ui_mode = "normal"
|
|
|
|
# Low gpu memory mode, this is used when the GPU memory is under 16GB
|
|
low_gpu_memory_mode = False
|
|
# Use torch.float16 if GPU does not support torch.bfloat16
|
|
# ome graphics cards, such as v100, 2080ti, do not support torch.bfloat16
|
|
weight_dtype = torch.bfloat16
|
|
|
|
# Server ip
|
|
server_name = "0.0.0.0"
|
|
server_port = 7860
|
|
|
|
# Params below is used when ui_mode = "modelscope"
|
|
edition = "v4"
|
|
config_path = "config/easyanimate_video_slicevae_multi_text_encoder_v4.yaml"
|
|
model_name = "models/Diffusion_Transformer/EasyAnimateV4-XL-2-InP"
|
|
savedir_sample = "samples"
|
|
|
|
if ui_mode == "modelscope":
|
|
demo, controller = ui_modelscope(edition, config_path, model_name, savedir_sample, low_gpu_memory_mode, weight_dtype)
|
|
elif ui_mode == "eas":
|
|
demo, controller = ui_eas(edition, config_path, model_name, savedir_sample)
|
|
else:
|
|
demo, controller = ui(low_gpu_memory_mode, weight_dtype)
|
|
|
|
# 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) |