jadechoghari commited on
Commit
9ec3715
1 Parent(s): 985e3db

Create run_vidtome.py

Browse files
Files changed (1) hide show
  1. run_vidtome.py +21 -0
run_vidtome.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from invert import Inverter
2
+ from generate import Generator
3
+ from utils import load_config, init_model, seed_everything, get_frame_ids
4
+
5
+ if __name__ == "__main__":
6
+ config = load_config()
7
+ pipe, scheduler, model_key = init_model(
8
+ config.device, config.sd_version, config.model_key, config.generation.control, config.float_precision)
9
+ config.model_key = model_key
10
+ seed_everything(config.seed)
11
+
12
+ print("Start inversion!")
13
+ inversion = Inverter(pipe, scheduler, config)
14
+ inversion(config.input_path, config.inversion.save_path)
15
+
16
+ print("Start generation!")
17
+ generator = Generator(pipe, scheduler, config)
18
+ frame_ids = get_frame_ids(
19
+ config.generation.frame_range, config.generation.frame_ids)
20
+ generator(config.input_path, config.generation.latents_path,
21
+ config.generation.output_path, frame_ids=frame_ids)