UI PostProcess - Zuntan03/EasyWan22 GitHub Wiki

This is post-processing for improving the quality of videos that hit the jackpot during seed gacha afterwards.

Please note that performing post-processing such as upscaling and frame interpolation during seed gacha is very inefficient.
The samples have post-processing enabled for generation reproduction purposes, so please be careful when using them as reference.

Basic procedure for post-processing with PostProcess and LoadWebpVideo

  1. Disable PostProcess and LoadWebpVideo in PostProcessSource and search for hits with seed gacha.
  2. Drag and drop the hit *.webp file to the blank area of ComfyUI to open it as a workflow.
  3. Enable LoadWebpVideo in PostProcessSource and open the *.webp file again with LoadWebpVideo.
  4. Enable PostProcess and Execute.
    • By default, Refiner, upscaling, and frame interpolation are enabled.

Refiner

The refiner enlarges the video while finishing details with LowNoise.

  • Steps specifies the number of rewrite steps.
  • UseUpscaler enlarges with an upscaler before rewriting. Recommended to enable.
  • LongSide specifies the size of the enlarged video by the number of pixels on the long side.
    Use a * 1.5 or a * 2.0 to make it 1.5x or 2x larger. You can also specify the pixel count directly like 1280.
  • AdditionalSeed adds this value to the normal seed for refinement.
    • Load the seed gacha hit from normal video generation with LoadWebpVideo in PostProcessSource, set AdditionalSeed to increment, and Execute (Immediate) to perform Refiner seed gacha.
    • When you hit the jackpot with Refiner's seed gacha, load the Refiner's hit video with LoadWebpVideo and disable Refiner again to continue applying Detailer, Upscale, and FrameInterpolation.

Detailer

Automatically detects faces and other features to enhance them at high resolution with detailed refinement similar to Refiner.

  • Steps specifies the amount of rewriting.
    For finishing without changing the image much, specify 1~2. For changing expressions etc. with region-specific prompts described later, specify 4~.
  • LongSide specifies the maximum long side after enlargement in pixels.
    Making it larger within the range that doesn't overflow VRAM will result in cleaner finishing.
  • Timing allows you to specify whether to apply Detailer before or after Refiner.
    • When applying Detailer before Refiner, Refiner will make the boundary lines of the rewrite area less noticeable.
    • When applying Detailer after Refiner, it becomes easier to preserve the results of region-specific prompt instructions.
  • AdditionalSeed adds this value to the normal seed for applying Detailer.
    • Load the seed gacha hit from normal video generation with LoadWebpVideo in PostProcessSource, set AdditionalSeed to increment, and Execute (Immediate) to perform Detailer seed gacha.
    • When you hit the jackpot with Detailer's seed gacha, load the Detailer's hit video with LoadWebpVideo and disable Detailer again to continue applying Upscale and FrameInterpolation.
  • Upscale uses upscaler during enlargement when enabled.
    Recommended to enable unless there are specific problems.

Detector

Detection methods for body parts and region-specific prompt specification are available.

  • Model selects YOLO-based detection models.
    Add detection models under Model/ultralytics/ to use them after pressing r key or reloading.
  • Threshold specifies the detection score.
    Lower values increase detection count, allowing previously undetected items to be detected, but also increase false positives.
    Conversely, higher values reduce detection count and suppress false positives, but may prevent detection.
  • TakeTarget specifies the sorting method for detected parts, and TakeOrder allows choosing between ascending or descending order. You can sort by area, width and height, vertical or horizontal position, and detection confidence.
  • TakeStart and TakeCount specify which detected parts (from which number and how many) to apply Detailer to.
    By setting TakeCount to 1 and shifting TakeStart, then loading the Asset.webp after Detailer with LoadWebpVideo, you can finish multiple faces one by one.
  • In the prompt input field, you can apply prompts for each detected part separated by , commas.
    Note that commas cannot be used within the prompt content itself.

Usage Examples

  • For simply improving part quality, set Steps to 2 and use Detailer ⇨ Refiner.
  • For changing appearance like expressions with prompts, set Steps to 4 and use Detailer ⇨ Refiner.
    • Reducing Refiner Steps from 2 to 1 makes it easier to maintain changes.
  • For rendering parts at maximum resolution, use Refiner ⇨ Detailer with Steps set to 2~4
    • Whether boundary lines are noticeable depends on luck, so use AdditionalSeed.

Trim

Trim(Start|End)Frames cuts the specified number of frames from the (beginning|end).

ColorMatch

Matches the colors of the start image and video.

ColorCorrect

Adjusts video colors with brightness, contrast, saturation, gamma, hue, and color shift.

RepeatFade

Cuts the first few frames of the video and cross-fades them at the end of the video.
This is for those who don't like the sharp switching when looping.
The video becomes shorter by the amount of cross-fade.

RepeatFadeFrames specifies the number of frames to cross-fade.

This is not a function to make videos loop cleanly.

Upscale

Upscales to 2x size.
While there are minor discrepancies, the average quality improves, so it's recommended for finishing post-processing.

AddLabel

Can display text strings at the top and bottom of the video. Japanese text is supported.
When AddLabelPreview is enabled, the video is changed to only 2 frames, allowing you to quickly check the label display results.

AppendVideo

Set a pre-prepared video to PreviousWebpVideo and concatenate the post-processed video.

TrimEndFrames can cut the end of the previous video.
When generating a video from the EndFrame of the previous video, duplicate frames can be removed.
If you want to remove the starting frame of the appended post-processing side, use TrimStartFrames.

AppendTiming allows you to select the timing for video concatenation.

  • PreUpscale: Use when you want to concatenate videos and then upscale them together.
  • PreAddLabel: Concatenate before adding labels. Use when you want to set the same label for both videos.
  • PreInterpolation: Concatenate before frame interpolation. Use when the previous video already has labels set and you want to specify different label content in post-processing.

FrameInterpolation

Interpolates between video frames to make them smoother. Recommended for finishing post-processing.
Choose from three types: 60FPS, 60FPS x1.3 Speed, 30FPS.

While not normally used, you can also directly specify FPS and frame interpolation multiplier with FrameRate and FrameMultiplier in VFI-Param.

FAQ

Post-processing has no effect even when enabled

To enable post-processing, you need to enable each function such as Refiner, Upscale, VideoFrameInterpolation, and also enable PostProcess which can toggle all post-processing on/off at once.

Post-processing includes the following functions on the right side of the workflow (in processing order):
Refiner, Trim, ColorMatch, PointMosaic, AutoMosaic, MaskMosaic, ColorCorrect, RepeatFade, Upscale, AddLabel, AppendVideo, VideoFrameInterpolation