Overlay mask working properly with static mask or video mask.
- made new masks.py file that we can use to consolidate other mask functions from main render code
- Overlay mask NOW WORKS WITH CADENCE. I made the function switchable between PIL rgb and np bgr and inject the function during cadence and for normal saves
- I didn't use old code. I just made this work myself.
Fixed one-off issue with hybrid video where the first frame was duplicated. (it became obvious when doing overlay video masking)
re-commented a few lines, removed some whitespace
new option to use init image as hybrid video
- you can use all normal compositing stuff with that mode.
- you can't use optical flow, because it's not a video - but - if there are already video frames in the directory, well - you should be able to still use flow and ransac modes, although I haven't tested that
changed Optical flow redo to a selection of optical flow type with None as default
- added Redo flow factor schedule
- made optical flow redo look nicer by warping the same image that it is using to compare to prev_img, then it goes in for final generation
changed Optical flow cadence to a selection of optical flow type with None as default
- added cadence flow factor schedule
Added flow guidance from last flow
- no UI change - it just works by default with hybrid motion optical flow types. It just uses the last flow as guidance, so it's a minor difference, but a little better temporal coherence on flow
changed hybrid composite to a selection with None as default
- now can set hybrid compositing to Normal (After Motion), Before Motion, or After Generation!
- Adds DIS Fine mode, and sets it as the new default
- Optical flow cadence and optical flow redo generation will now use DIS Fine, for pixel accuracy
- Adds flow guidance to hybrid flow. No setting needed, it just happens automatically, assisting the flow calculation by feeding in the last flow.
- Adds flow_factor_schedule for hybrid flow
- reduced some code for bordermode by setting a variable for the cv2 border mode translated from the user setting
- replaced Image,Resampling.LANCZOS with PIL.Image.LANCZOS
- had to add import PIL
- had heard of people on colab encountering this issue. Should fix both hybrid video and image/video color matching.
- tested, works fine locally, so I see no reason not to change
optional checkbox to include optical flow in normal cadence
-starts by getting flow between turbo_prev_image and turbo_next_image.
- after getting the flow, it warps the turbo_next_image with negative flow to match prev
- then, normal image warping during cadence happens
- then it warps the flow field to match the animation, first converting it to relative for warp, then back to absolute flow
- I calculate the flow division for each tween value and divide that by two.
- it then applies that tweened flow to the prev and next image
This update fixes remap's border behavior when applying optical flow.
- I extended the function so it extends borders and recrops.
- obeys wrap/replicate setting, except that wrap is replaced with reflect101
Removed optical flow options that don't work unless you run contrib version of opencv (SF and DenseRLOF)
- functions remain for possible future use if I can figure out how to run both opencv's.
Added 'DIS Medium' optical flow, which a dense flow, similar to the two types that we can't run.
Added checkbox control for hybrid_motion_use_prev_img
- makes all motion, whether ransac or flow, compare against previous rendered frame rather than previous video frame
Added color_coherence_force_grayscale
- forces grayscale before and after generation, so that color coherence mode can still be used (like color matching against video), but the image will be forced to grayscale. (NOTE: actual image file is still RGB)
The current code will always extract all of the input video frames.
This PR adds two new input parameters for extracting an input video:
extract from frame, and extract to frame.
Now we can only test frames 0 to 50, 50 to 100, etc.
better handling of wrong file/folder names, added function to delete all imgs from a folder (shorter code); now users can generate only the masks again even without having the 'generate_hybrid_frames' button selected