Merge branch 'main' into cross-platofrm

pull/27/head
Adam Letts 3 years ago committed by GitHub
commit f662775b7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      Disco_Diffusion.ipynb
  2. 9
      disco.py

@ -1102,9 +1102,7 @@
" skip_steps = args.calc_frames_skip_steps\n",
"\n",
" if args.animation_mode == \"3D\":\n",
" if frame_num == 0:\n",
" pass\n",
" else:\n",
" if frame_num > 0:\n",
" seed += 1 \n",
" if resume_run and frame_num == start_frame:\n",
" img_filepath = batchFolder+f\"/{batch_name}({batchNum})_{start_frame-1:04}.png\"\n",
@ -1409,7 +1407,7 @@
" image.save(f'{batchFolder}/{filename}')\n",
" if args.animation_mode == \"3D\":\n",
" # If turbo, save a blended image\n",
" if turbo_mode:\n",
" if turbo_mode and frame_num > 0:\n",
" # Mix new image with prevFrameScaled\n",
" blend_factor = (1)/int(turbo_steps)\n",
" newFrame = cv2.imread('prevFrame.png') # This is already updated..\n",
@ -1820,12 +1818,11 @@
" 'use_scale_shift_norm': True,\n",
" })\n",
"\n",
"secondary_model_ver = 2\n",
"model_default = model_config['image_size']\n",
"\n",
"\n",
"\n",
"if secondary_model_ver == 2:\n",
"if use_secondary_model:\n",
" secondary_model = SecondaryDiffusionImageNet2()\n",
" secondary_model.load_state_dict(torch.load(f'{model_path}/secondary_model_imagenet_2.pth', map_location='cpu'))\n",
" secondary_model.eval().requires_grad_(False).to(device)\n",

@ -1066,9 +1066,7 @@ def do_run():
skip_steps = args.calc_frames_skip_steps
if args.animation_mode == "3D":
if frame_num == 0:
pass
else:
if frame_num > 0:
seed += 1
if resume_run and frame_num == start_frame:
img_filepath = batchFolder+f"/{batch_name}({batchNum})_{start_frame-1:04}.png"
@ -1373,7 +1371,7 @@ def do_run():
image.save(f'{batchFolder}/{filename}')
if args.animation_mode == "3D":
# If turbo, save a blended image
if turbo_mode:
if turbo_mode and frame_num > 0:
# Mix new image with prevFrameScaled
blend_factor = (1)/int(turbo_steps)
newFrame = cv2.imread('prevFrame.png') # This is already updated..
@ -1774,12 +1772,11 @@ elif diffusion_model == '256x256_diffusion_uncond':
'use_scale_shift_norm': True,
})
secondary_model_ver = 2
model_default = model_config['image_size']
if secondary_model_ver == 2:
if use_secondary_model:
secondary_model = SecondaryDiffusionImageNet2()
secondary_model.load_state_dict(torch.load(f'{model_path}/secondary_model_imagenet_2.pth', map_location='cpu'))
secondary_model.eval().requires_grad_(False).to(device)

Loading…
Cancel
Save