@@ -46,6 +46,11 @@ def DeforumAnimArgs():
46
46
near_schedule = "0: (200)"
47
47
far_schedule = "0: (10000)"
48
48
seed_schedule = "0: (t%4294967293)"
49
+ # Anti-blur
50
+ kernel_schedule = "0: (5)"
51
+ sigma_schedule = "0: (1.0)"
52
+ amount_schedule = "0: (0.2)"
53
+ threshold_schedule = "0: (0.0)"
49
54
50
55
#@markdown ####**Coherence:**
51
56
histogram_matching = True #@param {type:"boolean"}
@@ -164,6 +169,7 @@ def DeforumArgs():
164
169
fill = 1 #MASKARGSEXPANSION Todo : Rename and convert to same formatting as used in img2img masked content
165
170
full_res_mask = True
166
171
full_res_mask_padding = 4
172
+ reroll_blank_frames = 'reroll' # reroll, interrupt, or ignore
167
173
168
174
n_samples = 1 # doesnt do anything
169
175
precision = 'autocast'
@@ -373,13 +379,27 @@ def show_vid():
373
379
i36 = gr .HTML ("<p style=\" margin-bottom:0.75em\" >To enable seed schedule select seed behavior — 'schedule'</p>" )
374
380
with gr .Row ():
375
381
seed_schedule = gr .Textbox (label = "seed_schedule" , lines = 1 , value = da .seed_schedule , interactive = True )
382
+
383
+ # Anti-blur
384
+ i38 = gr .HTML ("<p style=\" margin-bottom:0.75em\" >Anti-blur settings</p>" )
385
+ with gr .Row ():
386
+ kernel_schedule = gr .Textbox (label = "kernel_schedule" , lines = 1 , value = da .kernel_schedule , interactive = True )
387
+ with gr .Row ():
388
+ sigma_schedule = gr .Textbox (label = "sigma_schedule" , lines = 1 , value = da .sigma_schedule , interactive = True )
389
+ with gr .Row ():
390
+ amount_schedule = gr .Textbox (label = "amount_schedule" , lines = 1 , value = da .amount_schedule , interactive = True )
391
+ with gr .Row ():
392
+ threshold_schedule = gr .Textbox (label = "threshold_schedule" , lines = 1 , value = da .threshold_schedule , interactive = True )
376
393
377
394
i13 = gr .HTML ("<p style=\" margin-bottom:0.75em\" >Coherence:</p>" )
395
+ with gr .Row ():
396
+ # what to do with blank frames (they may result from glitches or the NSFW filter being turned on): reroll with +1 seed, interrupt the animation generation, or do nothing
397
+ reroll_blank_frames = gr .Dropdown (label = "reroll_blank_frames" , choices = ['reroll' , 'interrupt' , 'ignore' ], value = d .reroll_blank_frames , type = "value" , elem_id = "reroll_blank_frames" , interactive = True )
378
398
with gr .Row ():
379
399
histogram_matching = gr .Checkbox (label = "Force all frames to match initial frame's colors. Overrides a1111 settings. NOT RECOMMENDED, enable only for backwards compatibility." , value = da .histogram_matching , interactive = True )
380
400
with gr .Row ():
381
401
color_coherence = gr .Dropdown (label = "color_coherence" , choices = ['None' , 'Match Frame 0 HSV' , 'Match Frame 0 LAB' , 'Match Frame 0 RGB' ], value = da .color_coherence , type = "value" , elem_id = "color_coherence" , interactive = True )
382
- diffusion_cadence = gr .Slider (label = "diffusion_cadence" , minimum = 1 , maximum = 8 , step = 1 , value = 1 , interactive = True )
402
+ diffusion_cadence = gr .Number (label = "diffusion_cadence" , value = 1 , interactive = True )
383
403
384
404
i14 = gr .HTML ("<p style=\" margin-bottom:0.75em\" >3D Depth Warping:</p>" )
385
405
with gr .Row ():
@@ -516,12 +536,12 @@ def show_vid():
516
536
517
537
def setup_deforum_setting_ui (self , is_img2img , is_extension = True ):
518
538
ds = SimpleNamespace (** setup_deforum_setting_dictionary (self , is_img2img , is_extension ))
519
- return [ds .btn , ds .override_settings_with_file , ds .custom_settings_file , ds .animation_mode , ds .max_frames , ds .border , ds .angle , ds .zoom , ds .translation_x , ds .translation_y , ds .translation_z , ds .rotation_3d_x , ds .rotation_3d_y , ds .rotation_3d_z , ds .flip_2d_perspective , ds .perspective_flip_theta , ds .perspective_flip_phi , ds .perspective_flip_gamma , ds .perspective_flip_fv , ds .noise_schedule , ds .strength_schedule , ds .contrast_schedule , ds .cfg_scale_schedule , ds .fov_schedule , ds .near_schedule , ds .far_schedule , ds .seed_schedule , ds .histogram_matching , ds .color_coherence , ds .diffusion_cadence , ds .use_depth_warping , ds .midas_weight , ds .near_plane , ds .far_plane , ds .fov , ds .padding_mode , ds .sampling_mode , ds .save_depth_maps , ds .video_init_path , ds .extract_nth_frame , ds .overwrite_extracted_frames , ds .use_mask_video , ds .video_mask_path , ds .interpolate_key_frames , ds .interpolate_x_frames , ds .resume_from_timestring , ds .resume_timestring , ds .prompts , ds .animation_prompts , ds .W , ds .H , ds .restore_faces , ds .tiling , ds .enable_hr , ds .firstphase_width , ds .firstphase_height , ds .seed , ds .sampler , ds .seed_enable_extras , ds .subseed , ds .subseed_strength , ds .seed_resize_from_w , ds .seed_resize_from_h , ds .steps , ds .ddim_eta , ds .n_batch , ds .make_grid , ds .grid_rows , ds .save_settings , ds .save_samples , ds .display_samples , ds .save_sample_per_step , ds .show_sample_per_step , ds .override_these_with_webui , ds .batch_name , ds .filename_format , ds .seed_behavior , ds .use_init , ds .from_img2img_instead_of_link , ds .strength_0_no_init , ds .strength , ds .init_image , ds .use_mask , ds .use_alpha_as_mask , ds .invert_mask , ds .overlay_mask , ds .mask_file , ds .mask_contrast_adjust , ds .mask_brightness_adjust , ds .mask_overlay_blur , ds .fill , ds .full_res_mask , ds .full_res_mask_padding , ds .skip_video_for_run_all , ds .fps , ds .output_format , ds .ffmpeg_location , ds .add_soundtrack , ds .soundtrack_path , ds .use_manual_settings , ds .render_steps , ds .max_video_frames , ds .path_name_modifier , ds .image_path , ds .mp4_path , ds .parseq_manifest , ds .parseq_use_deltas , ds .i1 , ds .i2 , ds .i3 , ds .i4 , ds .i5 , ds .i6 , ds .i7 , ds .i8 , ds .i9 , ds .i10 , ds .i11 , ds .i12 , ds .i13 , ds .i14 , ds .i15 , ds .i16 , ds .i17 , ds .i18 , ds .i19 , ds .i20 , ds .i21 , ds .i22 , ds .i23 , ds .i24 , ds .i25 , ds .i26 , ds .i27 , ds .i28 , ds .i29 , ds .i30 , ds .i31 , ds .i32 , ds .i33 , ds .i34 , ds .i35 , ds .i36 , ds .i37 ]
539
+ return [ds .btn , ds .override_settings_with_file , ds .custom_settings_file , ds .animation_mode , ds .max_frames , ds .border , ds .angle , ds .zoom , ds .translation_x , ds .translation_y , ds .translation_z , ds .rotation_3d_x , ds .rotation_3d_y , ds .rotation_3d_z , ds .flip_2d_perspective , ds .perspective_flip_theta , ds .perspective_flip_phi , ds .perspective_flip_gamma , ds .perspective_flip_fv , ds .noise_schedule , ds .strength_schedule , ds .contrast_schedule , ds .cfg_scale_schedule , ds .fov_schedule , ds .near_schedule , ds .far_schedule , ds .seed_schedule , ds .kernel_schedule , ds .sigma_schedule , ds .amount_schedule , ds .threshold_schedule , ds .histogram_matching , ds .color_coherence , ds .diffusion_cadence , ds .use_depth_warping , ds .midas_weight , ds .near_plane , ds .far_plane , ds .fov , ds .padding_mode , ds .sampling_mode , ds .save_depth_maps , ds .video_init_path , ds .extract_nth_frame , ds .overwrite_extracted_frames , ds .use_mask_video , ds .video_mask_path , ds .interpolate_key_frames , ds .interpolate_x_frames , ds .resume_from_timestring , ds .resume_timestring , ds .prompts , ds .animation_prompts , ds .W , ds .H , ds .restore_faces , ds .tiling , ds .enable_hr , ds .firstphase_width , ds .firstphase_height , ds .seed , ds .sampler , ds .seed_enable_extras , ds .subseed , ds .subseed_strength , ds .seed_resize_from_w , ds .seed_resize_from_h , ds .steps , ds .ddim_eta , ds .n_batch , ds .make_grid , ds .grid_rows , ds .save_settings , ds .save_samples , ds .display_samples , ds .save_sample_per_step , ds .show_sample_per_step , ds .override_these_with_webui , ds .batch_name , ds .filename_format , ds .seed_behavior , ds .use_init , ds .from_img2img_instead_of_link , ds .strength_0_no_init , ds .strength , ds .init_image , ds .use_mask , ds .use_alpha_as_mask , ds .invert_mask , ds .overlay_mask , ds .mask_file , ds .mask_contrast_adjust , ds .mask_brightness_adjust , ds .mask_overlay_blur , ds .fill , ds .full_res_mask , ds .full_res_mask_padding , ds .reroll_blank_frames , ds .skip_video_for_run_all , ds .fps , ds .output_format , ds .ffmpeg_location , ds .add_soundtrack , ds .soundtrack_path , ds .use_manual_settings , ds .render_steps , ds .max_video_frames , ds .path_name_modifier , ds .image_path , ds .mp4_path , ds .parseq_manifest , ds .parseq_use_deltas , ds .i1 , ds .i2 , ds .i3 , ds .i4 , ds .i5 , ds .i6 , ds .i7 , ds .i8 , ds .i9 , ds .i10 , ds .i11 , ds .i12 , ds .i13 , ds .i14 , ds .i15 , ds .i16 , ds .i17 , ds .i18 , ds .i19 , ds .i20 , ds .i21 , ds .i22 , ds .i23 , ds .i24 , ds .i25 , ds .i26 , ds .i27 , ds .i28 , ds .i29 , ds .i30 , ds .i31 , ds .i32 , ds .i33 , ds .i34 , ds .i35 , ds .i36 , ds .i37 , ds .i38 ]
520
540
521
- def pack_anim_args (animation_mode , max_frames , border , angle , zoom , translation_x , translation_y , translation_z , rotation_3d_x , rotation_3d_y , rotation_3d_z , flip_2d_perspective , perspective_flip_theta , perspective_flip_phi , perspective_flip_gamma , perspective_flip_fv , noise_schedule , strength_schedule , contrast_schedule , cfg_scale_schedule , fov_schedule , near_schedule , far_schedule , seed_schedule , histogram_matching , color_coherence , diffusion_cadence , use_depth_warping , midas_weight , near_plane , far_plane , fov , padding_mode , sampling_mode , save_depth_maps , video_init_path , extract_nth_frame , overwrite_extracted_frames , use_mask_video , video_mask_path , interpolate_key_frames , interpolate_x_frames , resume_from_timestring , resume_timestring ):
541
+ def pack_anim_args (animation_mode , max_frames , border , angle , zoom , translation_x , translation_y , translation_z , rotation_3d_x , rotation_3d_y , rotation_3d_z , flip_2d_perspective , perspective_flip_theta , perspective_flip_phi , perspective_flip_gamma , perspective_flip_fv , noise_schedule , strength_schedule , contrast_schedule , cfg_scale_schedule , fov_schedule , near_schedule , far_schedule , seed_schedule , kernel_schedule , sigma_schedule , amount_schedule , threshold_schedule , histogram_matching , color_coherence , diffusion_cadence , use_depth_warping , midas_weight , near_plane , far_plane , fov , padding_mode , sampling_mode , save_depth_maps , video_init_path , extract_nth_frame , overwrite_extracted_frames , use_mask_video , video_mask_path , interpolate_key_frames , interpolate_x_frames , resume_from_timestring , resume_timestring ):
522
542
return locals ()
523
543
524
- def pack_args (W , H , restore_faces , tiling , enable_hr , firstphase_width , firstphase_height , seed , sampler , seed_enable_extras , subseed , subseed_strength , seed_resize_from_w , seed_resize_from_h , steps , ddim_eta , n_batch , make_grid , grid_rows , save_settings , save_samples , display_samples , save_sample_per_step , show_sample_per_step , override_these_with_webui , batch_name , filename_format , seed_behavior , use_init , from_img2img_instead_of_link , strength_0_no_init , strength , init_image , use_mask , use_alpha_as_mask , invert_mask , overlay_mask , mask_file , mask_contrast_adjust , mask_brightness_adjust , mask_overlay_blur , fill , full_res_mask , full_res_mask_padding ):
544
+ def pack_args (W , H , restore_faces , tiling , enable_hr , firstphase_width , firstphase_height , seed , sampler , seed_enable_extras , subseed , subseed_strength , seed_resize_from_w , seed_resize_from_h , steps , ddim_eta , n_batch , make_grid , grid_rows , save_settings , save_samples , display_samples , save_sample_per_step , show_sample_per_step , override_these_with_webui , batch_name , filename_format , seed_behavior , use_init , from_img2img_instead_of_link , strength_0_no_init , strength , init_image , use_mask , use_alpha_as_mask , invert_mask , overlay_mask , mask_file , mask_contrast_adjust , mask_brightness_adjust , mask_overlay_blur , fill , full_res_mask , full_res_mask_padding , reroll_blank_frames ):
525
545
precision = 'autocast'
526
546
scale = 7
527
547
C = 4
@@ -539,10 +559,10 @@ def pack_video_args(skip_video_for_run_all, fps, output_format, ffmpeg_location,
539
559
def pack_parseq_args (parseq_manifest , parseq_use_deltas ):
540
560
return locals ()
541
561
542
- def process_args (self , p , override_settings_with_file , custom_settings_file , animation_mode , max_frames , border , angle , zoom , translation_x , translation_y , translation_z , rotation_3d_x , rotation_3d_y , rotation_3d_z , flip_2d_perspective , perspective_flip_theta , perspective_flip_phi , perspective_flip_gamma , perspective_flip_fv , noise_schedule , strength_schedule , contrast_schedule , cfg_scale_schedule , fov_schedule , near_schedule , far_schedule , seed_schedule , histogram_matching , color_coherence , diffusion_cadence , use_depth_warping , midas_weight , near_plane , far_plane , fov , padding_mode , sampling_mode , save_depth_maps , video_init_path , extract_nth_frame , overwrite_extracted_frames , use_mask_video , video_mask_path , interpolate_key_frames , interpolate_x_frames , resume_from_timestring , resume_timestring , prompts , animation_prompts , W , H , restore_faces , tiling , enable_hr , firstphase_width , firstphase_height , seed , sampler , seed_enable_extras , subseed , subseed_strength , seed_resize_from_w , seed_resize_from_h , steps , ddim_eta , n_batch , make_grid , grid_rows , save_settings , save_samples , display_samples , save_sample_per_step , show_sample_per_step , override_these_with_webui , batch_name , filename_format , seed_behavior , use_init , from_img2img_instead_of_link , strength_0_no_init , strength , init_image , use_mask , use_alpha_as_mask , invert_mask , overlay_mask , mask_file , mask_contrast_adjust , mask_brightness_adjust , mask_overlay_blur , fill , full_res_mask , full_res_mask_padding , skip_video_for_run_all , fps , output_format , ffmpeg_location , add_soundtrack , soundtrack_path , use_manual_settings , render_steps , max_video_frames , path_name_modifier , image_path , mp4_path , parseq_manifest , parseq_use_deltas , i1 , i2 , i3 , i4 , i5 , i6 , i7 , i8 , i9 , i10 , i11 , i12 , i13 , i14 , i15 , i16 , i17 , i18 , i19 , i20 , i21 , i22 , i23 , i24 , i25 , i26 , i27 , i28 , i29 , i30 , i31 , i32 , i33 , i34 , i35 , i36 , i37 ):
562
+ def process_args (self , p , override_settings_with_file , custom_settings_file , animation_mode , max_frames , border , angle , zoom , translation_x , translation_y , translation_z , rotation_3d_x , rotation_3d_y , rotation_3d_z , flip_2d_perspective , perspective_flip_theta , perspective_flip_phi , perspective_flip_gamma , perspective_flip_fv , noise_schedule , strength_schedule , contrast_schedule , cfg_scale_schedule , fov_schedule , near_schedule , far_schedule , seed_schedule , kernel_schedule , sigma_schedule , amount_schedule , threshold_schedule , histogram_matching , color_coherence , diffusion_cadence , use_depth_warping , midas_weight , near_plane , far_plane , fov , padding_mode , sampling_mode , save_depth_maps , video_init_path , extract_nth_frame , overwrite_extracted_frames , use_mask_video , video_mask_path , interpolate_key_frames , interpolate_x_frames , resume_from_timestring , resume_timestring , prompts , animation_prompts , W , H , restore_faces , tiling , enable_hr , firstphase_width , firstphase_height , seed , sampler , seed_enable_extras , subseed , subseed_strength , seed_resize_from_w , seed_resize_from_h , steps , ddim_eta , n_batch , make_grid , grid_rows , save_settings , save_samples , display_samples , save_sample_per_step , show_sample_per_step , override_these_with_webui , batch_name , filename_format , seed_behavior , use_init , from_img2img_instead_of_link , strength_0_no_init , strength , init_image , use_mask , use_alpha_as_mask , invert_mask , overlay_mask , mask_file , mask_contrast_adjust , mask_brightness_adjust , mask_overlay_blur , fill , full_res_mask , full_res_mask_padding , reroll_blank_frames , skip_video_for_run_all , fps , output_format , ffmpeg_location , add_soundtrack , soundtrack_path , use_manual_settings , render_steps , max_video_frames , path_name_modifier , image_path , mp4_path , parseq_manifest , parseq_use_deltas , i1 , i2 , i3 , i4 , i5 , i6 , i7 , i8 , i9 , i10 , i11 , i12 , i13 , i14 , i15 , i16 , i17 , i18 , i19 , i20 , i21 , i22 , i23 , i24 , i25 , i26 , i27 , i28 , i29 , i30 , i31 , i32 , i33 , i34 , i35 , i36 , i37 , i38 ):
543
563
544
- args_dict = pack_args (W , H , restore_faces , tiling , enable_hr , firstphase_width , firstphase_height , seed , sampler , seed_enable_extras , subseed , subseed_strength , seed_resize_from_w , seed_resize_from_h , steps , ddim_eta , n_batch , make_grid , grid_rows , save_settings , save_samples , display_samples , save_sample_per_step , show_sample_per_step , override_these_with_webui , batch_name , filename_format , seed_behavior , use_init , from_img2img_instead_of_link , strength_0_no_init , strength , init_image , use_mask , use_alpha_as_mask , invert_mask , overlay_mask , mask_file , mask_contrast_adjust , mask_brightness_adjust , mask_overlay_blur , fill , full_res_mask , full_res_mask_padding )
545
- anim_args_dict = pack_anim_args (animation_mode , max_frames , border , angle , zoom , translation_x , translation_y , translation_z , rotation_3d_x , rotation_3d_y , rotation_3d_z , flip_2d_perspective , perspective_flip_theta , perspective_flip_phi , perspective_flip_gamma , perspective_flip_fv , noise_schedule , strength_schedule , contrast_schedule , cfg_scale_schedule , fov_schedule , near_schedule , far_schedule , seed_schedule , histogram_matching , color_coherence , diffusion_cadence , use_depth_warping , midas_weight , near_plane , far_plane , fov , padding_mode , sampling_mode , save_depth_maps , video_init_path , extract_nth_frame , overwrite_extracted_frames , use_mask_video , video_mask_path , interpolate_key_frames , interpolate_x_frames , resume_from_timestring , resume_timestring )
564
+ args_dict = pack_args (W , H , restore_faces , tiling , enable_hr , firstphase_width , firstphase_height , seed , sampler , seed_enable_extras , subseed , subseed_strength , seed_resize_from_w , seed_resize_from_h , steps , ddim_eta , n_batch , make_grid , grid_rows , save_settings , save_samples , display_samples , save_sample_per_step , show_sample_per_step , override_these_with_webui , batch_name , filename_format , seed_behavior , use_init , from_img2img_instead_of_link , strength_0_no_init , strength , init_image , use_mask , use_alpha_as_mask , invert_mask , overlay_mask , mask_file , mask_contrast_adjust , mask_brightness_adjust , mask_overlay_blur , fill , full_res_mask , full_res_mask_padding , reroll_blank_frames )
565
+ anim_args_dict = pack_anim_args (animation_mode , max_frames , border , angle , zoom , translation_x , translation_y , translation_z , rotation_3d_x , rotation_3d_y , rotation_3d_z , flip_2d_perspective , perspective_flip_theta , perspective_flip_phi , perspective_flip_gamma , perspective_flip_fv , noise_schedule , strength_schedule , contrast_schedule , cfg_scale_schedule , fov_schedule , near_schedule , far_schedule , seed_schedule , kernel_schedule , sigma_schedule , amount_schedule , threshold_schedule , histogram_matching , color_coherence , diffusion_cadence , use_depth_warping , midas_weight , near_plane , far_plane , fov , padding_mode , sampling_mode , save_depth_maps , video_init_path , extract_nth_frame , overwrite_extracted_frames , use_mask_video , video_mask_path , interpolate_key_frames , interpolate_x_frames , resume_from_timestring , resume_timestring )
546
566
video_args_dict = pack_video_args (skip_video_for_run_all , fps , output_format , ffmpeg_location , add_soundtrack , soundtrack_path , use_manual_settings , render_steps , max_video_frames , path_name_modifier , image_path , mp4_path )
547
567
parseq_args_dict = pack_parseq_args (parseq_manifest , parseq_use_deltas )
548
568
0 commit comments