Slight turbo mode cleanup. Added questionable code to protect people who may modify the settings code (or that may hurt them - It could go either way)

pull/14/head
Adam Letts 3 years ago
parent 0e366efcf9
commit 1704be96f8
  1. 9
      Disco_Diffusion.ipynb
  2. 9
      disco.py

@ -1119,9 +1119,10 @@
"\n",
" ### Turbo mode - skip some diffusions, use 3d morph for clarity and to save time\n",
" turbo_blend = False # default for non-turbo frame saving\n",
" if turbo_mode == True and frame_num == turbo_preroll: #start tracking oldframe\n",
" if turbo_mode:\n",
" if frame_num == turbo_preroll: #start tracking oldframe\n",
" next_step_pil.save('oldFrameScaled.png')#stash for later blending \n",
" if turbo_mode == True and frame_num > turbo_preroll:\n",
" elif frame_num > turbo_preroll:\n",
" #set up 2 warped image sequences, old & new, to blend toward new diff image\n",
" old_frame = do_3d_step('oldFrameScaled.png', frame_num, midas_model, midas_transform)\n",
" old_frame.save('oldFrameScaled.png')\n",
@ -3006,11 +3007,11 @@
" 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 > turbo_preroll and start_frame % int(turbo_steps) != 0:\n",
" if animation_mode != '3D' and turbo_mode == True and start_frame > turbo_preroll 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 > turbo_preroll and start_frame % int(turbo_steps) != 0:\n",
" if animation_mode != '3D' and turbo_mode == True and start_frame > turbo_preroll 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",

@ -1026,9 +1026,10 @@ def do_run():
### Turbo mode - skip some diffusions, use 3d morph for clarity and to save time
turbo_blend = False # default for non-turbo frame saving
if turbo_mode == True and frame_num == turbo_preroll: #start tracking oldframe
if turbo_mode:
if frame_num == turbo_preroll: #start tracking oldframe
next_step_pil.save('oldFrameScaled.png')#stash for later blending
if turbo_mode == True and frame_num > turbo_preroll:
elif frame_num > turbo_preroll:
#set up 2 warped image sequences, old & new, to blend toward new diff image
old_frame = do_3d_step('oldFrameScaled.png', frame_num, midas_model, midas_transform)
old_frame.save('oldFrameScaled.png')
@ -2829,11 +2830,11 @@ if resume_run:
batchNum = int(run_to_resume)
if resume_from_frame == 'latest':
start_frame = len(glob(batchFolder+f"/{batch_name}({batchNum})_*.png"))
if turbo_mode == True and start_frame > turbo_preroll and start_frame % int(turbo_steps) != 0:
if animation_mode != '3D' and turbo_mode == True and start_frame > turbo_preroll and start_frame % int(turbo_steps) != 0:
start_frame = start_frame - (start_frame % int(turbo_steps))
else:
start_frame = int(resume_from_frame)+1
if turbo_mode == True and start_frame > turbo_preroll and start_frame % int(turbo_steps) != 0:
if animation_mode != '3D' and turbo_mode == True and start_frame > turbo_preroll and start_frame % int(turbo_steps) != 0:
start_frame = start_frame - (start_frame % int(turbo_steps))
if retain_overwritten_frames is True:
existing_frames = len(glob(batchFolder+f"/{batch_name}({batchNum})_*.png"))

Loading…
Cancel
Save