deforum-art / sd-webui-deforum

Deforum extension for AUTOMATIC1111's Stable Diffusion webui
https://deforum.github.io
Other
2.7k stars 390 forks source link

Turning off use_depth_warping in 3d mode results in TypeError: must be real number, not NoneType #123

Closed ReinerBforartists closed 1 year ago

ReinerBforartists commented 1 year ago

Hey friends.

I unticked the use_depth_warping, and got a warning then. The values are the defaults. All that was changed was the prompt name, i switched to 3d mode, and i have unticked use_depth_warping. Turning it on again, and the video gets created again.

Both, automatic1111 and the deforum-for-automatic1111-webui repo are up to date.

`venv "E:\automattic111\stable-diffusion-webui\venv\Scripts\Python.exe" Python 3.9.9 (tags/v3.9.9:ccb0e6a, Nov 15 2021, 18:08:50) [MSC v.1929 64 bit (AMD64)] Commit hash: 4b3c5bc24bffdf429c463a465763b3077fe55eb8 Installing requirements for Web UI Launching Web UI with arguments: --disable-safe-unpickle No module 'xformers'. Proceeding without it. LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. Loading weights [81761151] from E:\automattic111\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.ckpt Applying cross attention optimization (Doggettx). Model loaded. Loaded a total of 0 textual inversion embeddings. Embeddings: Running on local URL: http://127.0.0.1:7860/

To create a public link, set share=True in launch(). Deforum script for 2D, pseudo-2D and 3D animations v0.5-webui-beta Additional models path: E:\automattic111\stable-diffusion-webui\models/Deforum Saving animation frames to E:\automattic111\stable-diffusion-webui\outputs/img2img-images\Deforum Rendering animation frame 0 of 120 a blackbird in a tree 1607159813 Angle: 0.0 Zoom: 1.02 Tx: 0.0 Ty: 0.0 Tz: 10.0 Rx: 0.0 Ry: 0.0 Rz: 0.0 Positive prompt:a blackbird in a tree Not using an init image (doing pure txt2img) - seed:1607159813; subseed:-1; subseed_strength:0; cfg_scale:7.0; steps:21 100%|██████████████████████████████████████████████████████████████████████████████████| 21/21 [00:04<00:00, 4.76it/s] Rendering animation frame 1 of 120 | 21/1092 [00:02<02:22, 7.50it/s] Deforum progress: 2%|█▏ | 21/1092 [00:03<02:39, 6.72it/s] Error completing request Arguments: (False, '', '3D', 120, 'replicate', '0:(0)', '0:(1.02+0.02sin(23.14*t/20))', '0:(0)', '0:(0)', '0:(10)', '0:(0)', '0:(0)', '0:(0)', False, '0:(0)', '0:(t%15)', '0:(0)', '0:(53)', '0: (0.08)', '0: (0.6)', '0: (1.0)', '0: (7)', '0: (40)', '0: (200)', '0: (10000)', '0: (t%4294967293)', 'Match Frame 0 LAB', 1, False, 0.3, 200.0, 10000.0, 40.0, 'border', 'bicubic', False, '/content/video_in.mp4', 1, False, False, '/content/video_in.mp4', False, 4, False, '20220829210106', '[\n "a beautiful forest by Asher Brown Durand, trending on Artstation",\n "a beautiful portrait of a woman by Artgerm, trending on Artstation"\n]\n', '{\n "0": "a blackbird in a tree"\n}\n', 512, 512, False, False, False, 0, 0, -1, 'Euler a', False, -1, 0, 0, 0, 21, 0.0, 1, False, 1, True, True, False, False, False, False, 'Deforum', '{timestring}{index}{prompt}.png', 'iter', False, False, True, 0, 'https://user-images.githubusercontent.com/14872007/195867706-d067cdc6-28cd-450b-a61e-55e25bc67010.png', False, False, False, True, 'https://www.filterforge.com/wiki/images/archive/b/b7/20080927223728%21Polygonal_gradient_thumb.jpg', 1.0, 1.0, 5.0, 1, True, 4, False, 12.0, 'PIL gif', 'ffmpeg', False, 'snowfall.mp3', False, False, 200.0, 'x0pred', '/content/drive/MyDrive/AI/StableDiffusion/2022-09/20220903000939%05d.png', '/content/drive/MyDrive/AI/StableDiffusion/content/drive/MyDrive/AI/StableDiffusion/2022-09/kabachuha/2022-09/20220903000939.mp4', '

Deforum v0.5-webui-beta

', " Made by deforum.github.io, port for AUTOMATIC1111's webui maintained by kabachuha

", ' Original Deforum Github repo github.com/deforum/stable-diffusion

', " This fork for auto1111's webui github.com/deforum-art/deforum-for-automatic1111-webui

", ' Join the official Deforum Discord discord.gg/deforum to share your creations and suggestions

', ' User guide for v0.5 docs.google.com/document/d/1pEobUknMFMkn8F5TMsv8qRzamXX_75BShMMXV8IFslI/edit

', ' Math keyframing explanation docs.google.com/document/d/1pfW1PwbDIuW0cv-dnuyYj1UzPqe23BlSLTJsqazffXM/edit?usp=sharing

', ' Import settings from file

', ' Animation settings

', ' Motion parameters:

', ' 2D and 3D settings

', ' Prespective flip — Low VRAM pseudo-3D mode:

', ' Coherence:

', ' 3D Depth Warping:

', ' Video Input:

', ' Interpolation (turned off atm)

', ' Resume animation:

', ' Prompts

', ' animation_mode: None batches on list of prompts. (Batch mode disabled atm, only animation_prompts are working)

', ' Important change from vanilla Deforum!

', ' This script uses the built-in webui weighting settings.

', ' So if you want to use math functions as prompt weights,

', ' keep the values above zero in both parts

', ' Negative prompt part can be specified with --neg

', ' Run settings

', ' Sampling settings

', ' 3D Fov settings:

', '', '', '', ' Batch settings

', ' Init settings

', ' 3D settings

', ' Generation settings:

', ' Video output settings

', ' To enable seed schedule select seed behavior — 'schedule'

') {} Traceback (most recent call last): File "E:\automattic111\stable-diffusion-webui\modules\call_queue.py", line 45, in f res = list(func(*args, *kwargs)) File "E:\automattic111\stable-diffusion-webui\modules\call_queue.py", line 28, in f res = func(args, **kwargs) File "E:\automattic111\stable-diffusion-webui\extensions\deforum\scripts\deforum.py", line 231, in run_deforum processed = DeforumScript.run(None, 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, 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, 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) File "E:\automattic111\stable-diffusion-webui\extensions\deforum\scripts\deforum.py", line 73, in run render_animation(args, anim_args, root.animation_prompts, root) File "E:\automattic111\stable-diffusion-webui\extensions\deforum\scripts\deforum_helpers\render.py", line 168, in render_animation prev_img = anim_frame_warp_3d(root.device, prev_img_cv2, depth, anim_args, keys, frame_idx) File "E:\automattic111\stable-diffusion-webui\extensions\deforum\scripts\deforum_helpers\animation.py", line 210, in anim_frame_warp_3d result = transform_image_3d(device if not device.type.startswith('mps') else torch.device('cpu'), prev_img_cv2, depth, rot_mat, translate_xyz, anim_args, keys, frame_idx) File "E:\automattic111\stable-diffusion-webui\extensions\deforum\scripts\deforum_helpers\animation.py", line 227, in transform_image_3d z = torch.as_tensor(depth_tensor, dtype=torch.float32, device=device) TypeError: must be real number, not NoneType `

Zarxrax commented 1 year ago

I believe this was recently fixed in the notebook, so could probably port the fix into the extension easily.

Funofabot commented 1 year ago

I believe this was recently fixed in the notebook, so could probably port the fix into the extension easily.

This was fixed in my notebook sync but it didnt get pulled and other changes forced me to close it. So I closed it to split it up in smaller chunks, there should be pr's to reflect this ITNF hopefully this weekend.

Funofabot commented 1 year ago

I posted a PR to sync with notebook in this regard. It may take a couple days or be quick. But I just posted it for you guys to test.