|
|
|
@ -1110,6 +1110,18 @@ |
|
|
|
|
" args.fov, padding_mode=args.padding_mode,\n", |
|
|
|
|
" sampling_mode=args.sampling_mode, midas_weight=args.midas_weight)\n", |
|
|
|
|
" next_step_pil.save('prevFrameScaled.png')\n", |
|
|
|
|
"\n", |
|
|
|
|
" ### Turbo mode - skip some diffusions to save time \n", |
|
|
|
|
" if turbo_mode == True and frame_num > 10 and frame_num % int(turbo_steps) != 0:\n", |
|
|
|
|
" print('turbo mode is on this frame: skipping clip diffusion steps')\n", |
|
|
|
|
" filename = f'{args.batch_name}({args.batchNum})_{frame_num:04}.png'\n", |
|
|
|
|
" next_step_pil.save(f'{batchFolder}/{filename}') #save it as this frame\n", |
|
|
|
|
" next_step_pil.save(f'{img_filepath}') # save it also as prev_frame for next iteration\n", |
|
|
|
|
" continue\n", |
|
|
|
|
" elif turbo_mode == True:\n", |
|
|
|
|
" print('turbo mode is OFF this frame')\n", |
|
|
|
|
" #else: no turbo\n", |
|
|
|
|
"\n", |
|
|
|
|
" init_image = 'prevFrameScaled.png'\n", |
|
|
|
|
" init_scale = args.frames_scale\n", |
|
|
|
|
" skip_steps = args.calc_frames_skip_steps\n", |
|
|
|
@ -1460,6 +1472,8 @@ |
|
|
|
|
" 'sampling_mode': sampling_mode,\n", |
|
|
|
|
" 'video_init_path':video_init_path,\n", |
|
|
|
|
" 'extract_nth_frame':extract_nth_frame,\n", |
|
|
|
|
" 'turbo_mode':turbo_mode,\n", |
|
|
|
|
" 'turbo_steps':turbo_steps,\n", |
|
|
|
|
" }\n", |
|
|
|
|
" # print('Settings:', setting_list)\n", |
|
|
|
|
" with open(f\"{batchFolder}/{batch_name}({batchNum})_settings.txt\", \"w+\") as f: #save settings\n", |
|
|
|
@ -2504,6 +2518,14 @@ |
|
|
|
|
"padding_mode = 'border'#@param {type:\"string\"}\n", |
|
|
|
|
"sampling_mode = 'bicubic'#@param {type:\"string\"}\n", |
|
|
|
|
"\n", |
|
|
|
|
"#======= TURBO MODE\n", |
|
|
|
|
"#@markdown ---\n", |
|
|
|
|
"#@markdown ####**Turbo Mode (3D anim only):**\n", |
|
|
|
|
"#@markdown (Starts after frame 10,) skips diffusion steps and just uses MIDAS depth map to warp images for skipped frames.\n", |
|
|
|
|
"#@markdown Speeds up rendering by 2x-4x, and may improve image coherence between frames.\n", |
|
|
|
|
"\n", |
|
|
|
|
"turbo_mode = True #@param {type:\"boolean\"}\n", |
|
|
|
|
"turbo_steps = \"3\" #@param [\"2\",\"3\",\"4\"] {type:'string'}\n", |
|
|
|
|
"#@markdown ---\n", |
|
|
|
|
"\n", |
|
|
|
|
"#@markdown ####**Coherency Settings:**\n", |
|
|
|
@ -2939,8 +2961,12 @@ |
|
|
|
|
" batchNum = int(run_to_resume)\n", |
|
|
|
|
" if resume_from_frame == 'latest':\n", |
|
|
|
|
" start_frame = len(glob(batchFolder+f\"/{batch_name}({batchNum})_*.png\"))\n", |
|
|
|
|
" if turbo_mode == True and start_frame > 10 and start_frame % int(turbo_steps) != 0:\n", |
|
|
|
|
" start_frame = start_frame - (start_frame % int(turbo_steps))\n", |
|
|
|
|
" else:\n", |
|
|
|
|
" start_frame = int(resume_from_frame)+1\n", |
|
|
|
|
" if turbo_mode == True and start_frame > 10 and start_frame % int(turbo_steps) != 0:\n", |
|
|
|
|
" start_frame = start_frame - (start_frame % int(turbo_steps))\n", |
|
|
|
|
" if retain_overwritten_frames is True:\n", |
|
|
|
|
" existing_frames = len(glob(batchFolder+f\"/{batch_name}({batchNum})_*.png\"))\n", |
|
|
|
|
" frames_to_save = existing_frames - start_frame\n", |
|
|
|
|