diff --git a/Disco_Diffusion.ipynb b/Disco_Diffusion.ipynb index 707838e..b32bfe8 100644 --- a/Disco_Diffusion.ipynb +++ b/Disco_Diffusion.ipynb @@ -237,11 +237,11 @@ "\n", " Separated transform code\n", "\n", - " v5.01 Update: March 10th 2022 - gandamu / Adam Letts\n", + " v5.01 Update: Mar 10th 2022 - gandamu / Adam Letts\n", "\n", " IPython magic commands replaced by Python code\n", "\n", - " v5.1 Update: March 30th 2022 - zippy / Chris Allen and gandamu / Adam Letts\n", + " v5.1 Update: Mar 30th 2022 - zippy / Chris Allen and gandamu / Adam Letts\n", "\n", " Integrated Turbo+Smooth features from Disco Diffusion Turbo -- just the implementation, without its defaults.\n", "\n", @@ -249,6 +249,8 @@ "\n", " 3D rotation parameter units are now degrees (rather than radians)\n", "\n", + " Corrected name collision in sampling_mode (now diffusion_sampling_mode for plms/ddim, and sampling_mode for 3D transform sampling)\n", + "\n", " '''\n", " )\n" ], @@ -1319,7 +1321,7 @@ " return grad * magnitude.clamp(max=args.clamp_max) / magnitude #min=-0.02, min=-clamp_max, \n", " return grad\n", " \n", - " if args.sampling_mode == 'ddim':\n", + " if args.diffusion_sampling_mode == 'ddim':\n", " sample_fn = diffusion.ddim_sample_loop_progressive\n", " else:\n", " sample_fn = diffusion.plms_sample_loop_progressive\n", @@ -1342,7 +1344,7 @@ " if perlin_init:\n", " init = regen_perlin()\n", "\n", - " if args.sampling_mode == 'ddim':\n", + " if args.diffusion_sampling_mode == 'ddim':\n", " samples = sample_fn(\n", " model,\n", " (batch_size, 3, args.side_y, args.side_x),\n", @@ -1485,7 +1487,7 @@ " 'use_secondary_model': use_secondary_model,\n", " 'steps': steps,\n", " 'diffusion_steps': diffusion_steps,\n", - " 'sampling_mode': sampling_mode,\n", + " 'diffusion_sampling_mode': diffusion_sampling_mode,\n", " 'ViTB32': ViTB32,\n", " 'ViTB16': ViTB16,\n", " 'ViTL14': ViTL14,\n", @@ -2254,7 +2256,7 @@ "#@markdown ####**Models Settings:**\n", "diffusion_model = \"512x512_diffusion_uncond_finetune_008100\" #@param [\"256x256_diffusion_uncond\", \"512x512_diffusion_uncond_finetune_008100\"]\n", "use_secondary_model = True #@param {type: 'boolean'}\n", - "sampling_mode = 'ddim' #@param ['plms','ddim'] \n", + "diffusion_sampling_mode = 'ddim' #@param ['plms','ddim'] \n", "\n", "timestep_respacing = '250' #@param ['25','50','100','150','250','500','1000','ddim25','ddim50', 'ddim75', 'ddim100','ddim150','ddim250','ddim500','ddim1000'] \n", "diffusion_steps = 1000 #@param {type: 'number'}\n", @@ -3056,7 +3058,7 @@ " 'batch_size':batch_size,\n", " 'batch_name': batch_name,\n", " 'steps': steps,\n", - " 'sampling_mode': sampling_mode,\n", + " 'diffusion_sampling_mode': diffusion_sampling_mode,\n", " 'width_height': width_height,\n", " 'clip_guidance_scale': clip_guidance_scale,\n", " 'tv_scale': tv_scale,\n", @@ -3265,7 +3267,7 @@ "ExtraSetTop" ], "machine_shape": "hm", - "name": "Disco Diffusion v5 [w/ 3D animation]", + "name": "Disco Diffusion v5.1 [w/ Turbo]", "private_outputs": true, "provenance": [], "include_colab_link": true diff --git a/disco.py b/disco.py index f3903f2..16caaf0 100644 --- a/disco.py +++ b/disco.py @@ -200,16 +200,20 @@ if skip_for_run_all == False: Separated transform code - v5.01 Update: March 10th 2022 - gandamu / Adam Letts + v5.01 Update: Mar 10th 2022 - gandamu / Adam Letts IPython magic commands replaced by Python code - v5.1 Update: March 30th 2022 - zippy / Chris Allen and gandamu / Adam Letts + v5.1 Update: Mar 30th 2022 - zippy / Chris Allen and gandamu / Adam Letts Integrated Turbo+Smooth features from Disco Diffusion Turbo -- just the implementation, without its defaults. Implemented resume of turbo animations in such a way that it's now possible to resume from different batch folders and batch numbers. + 3D rotation parameter units are now degrees (rather than radians) + + Corrected name collision in sampling_mode (now diffusion_sampling_mode for plms/ddim, and sampling_mode for 3D transform sampling) + ''' ) @@ -1224,7 +1228,7 @@ def do_run(): return grad * magnitude.clamp(max=args.clamp_max) / magnitude #min=-0.02, min=-clamp_max, return grad - if args.sampling_mode == 'ddim': + if args.diffusion_sampling_mode == 'ddim': sample_fn = diffusion.ddim_sample_loop_progressive else: sample_fn = diffusion.plms_sample_loop_progressive @@ -1247,7 +1251,7 @@ def do_run(): if perlin_init: init = regen_perlin() - if args.sampling_mode == 'ddim': + if args.diffusion_sampling_mode == 'ddim': samples = sample_fn( model, (batch_size, 3, args.side_y, args.side_x), @@ -1390,7 +1394,7 @@ def save_settings(): 'use_secondary_model': use_secondary_model, 'steps': steps, 'diffusion_steps': diffusion_steps, - 'sampling_mode': sampling_mode, + 'diffusion_sampling_mode': diffusion_sampling_mode, 'ViTB32': ViTB32, 'ViTB16': ViTB16, 'ViTL14': ViTL14, @@ -2130,7 +2134,7 @@ def do_superres(img, filepath): #@markdown ####**Models Settings:** diffusion_model = "512x512_diffusion_uncond_finetune_008100" #@param ["256x256_diffusion_uncond", "512x512_diffusion_uncond_finetune_008100"] use_secondary_model = True #@param {type: 'boolean'} -sampling_mode = 'ddim' #@param ['plms','ddim'] +diffusion_sampling_mode = 'ddim' #@param ['plms','ddim'] timestep_respacing = '250' #@param ['25','50','100','150','250','500','1000','ddim25','ddim50', 'ddim75', 'ddim100','ddim150','ddim250','ddim500','ddim1000'] diffusion_steps = 1000 #@param {type: 'number'} @@ -2877,7 +2881,7 @@ args = { 'batch_size':batch_size, 'batch_name': batch_name, 'steps': steps, - 'sampling_mode': sampling_mode, + 'diffusion_sampling_mode': diffusion_sampling_mode, 'width_height': width_height, 'clip_guidance_scale': clip_guidance_scale, 'tv_scale': tv_scale,