Adds native SeedVR2 support - #1463
Open
jtreminio wants to merge 7 commits into
Open
Conversation
|
|
||
| (TODO) | ||
|
|
||
| # Upscale Stages |
|
|
||
| /// <summary>Set of all feature-ids supported by ComfyUI backends.</summary> | ||
| public static HashSet<string> FeaturesSupported = ["comfyui", "refiners", "controlnet", "endstepsearly", "seamless", "video", "variation_seed", "freeu", "yolov8"]; | ||
| public static HashSet<string> FeaturesSupported = ["comfyui", "refiners", "controlnet", "endstepsearly", "seamless", "video", "variation_seed", "freeu", "yolov8", "seedvr2"]; |
| GetValues: (session) => [.. UpscalerModels, .. PidUpscaleModels(session)], DependNonDefault: T2IParamTypes.RefinerUpscale.Type.ID | ||
| GetValues: (session) => [.. UpscalerModels, .. PidUpscaleModels(session), .. SeedVR2UpscaleModels(session)], DependNonDefault: T2IParamTypes.RefinerUpscale.Type.ID | ||
| )); | ||
| FinalUpscaleMethod = T2IParamTypes.Register<string>(new("Final Upscale Method", "How to upscale the image, if upscaling is used.\nNo sampler runs after this, so latent upscalers are not available here.", |
| "256", Min: 64, Max: 2048, Step: 32, Toggleable: true, IsAdvanced: true, FeatureFlag: "comfyui", ViewType: ParamViewType.POT_SLIDER, Group: T2IParamTypes.GroupAdvancedSampling, OrderPriority: 20 | ||
| )); | ||
| SeedVR2ColorCorrectionBehavior = T2IParamTypes.Register<string>(new("SeedVR2 Color Correction Behavior", "How to match the colors of a SeedVR2 upscale back to the image it was given.\n'None' = Do not attempt color correction, only align the geometry.\n'CIELAB' = Transfer the color in CIELAB space, preserving detail.\n'Wavelet' = Transfer the low-frequency color, keeping the upscaled high-frequency detail.\n'AdaIN' = Match the per-channel mean and standard deviation.", | ||
| "none", FeatureFlag: "seedvr2", Group: T2IParamTypes.GroupAdvancedSampling, IsAdvanced: true, OrderPriority: 21, GetValues: (_) => ["none///None", "lab///CIELAB", "wavelet///Wavelet", "adain///AdaIN"] |
| "false", IgnoreIf: "false", FeatureFlag: "seedvr2", Group: T2IParamTypes.GroupAdvancedSampling, IsAdvanced: true, OrderPriority: 22 | ||
| )); | ||
| SeedVR2TemporalVideoOverlap = T2IParamTypes.Register<int>(new("SeedVR2 Temporal Video Overlap", "Overrides 'VAE Temporal Tile Overlap' for 'SeedVR2 Split Latent' chunks.\nHigher overlap hides the chunk seams better but takes longer.", | ||
| "0", Min: 0, Max: 4096, Step: 1, Toggleable: true, VisibleNormally: false, IsAdvanced: true, FeatureFlag: "seedvr2", Group: T2IParamTypes.GroupAdvancedSampling, OrderPriority: 23 |
Member
There was a problem hiding this comment.
Why is this VisibleNormally: false?
| ["vae_conditioning"] = latent | ||
| }); | ||
| string sampled = CreateKSampler(CurrentModel.Path, [cond, 0], [cond, 1], latent, 1, 1, 0, 10000, seed, false, true, | ||
| explicitSampler: "euler", explicitScheduler: "simple"); |
| { | ||
| return ScaleRawMedia(raw, width, height, method.After("pixel-")); | ||
| } | ||
| throw new SwarmUserErrorException($"Upscale method '{method}' needs a sampler after it, so it can't be used as a Final Upscale Method. Use it in the Refine/Upscale group instead."); |
Member
There was a problem hiding this comment.
odd message, this isn't correct for any upscale method
| // TODO: Better same-VAE check | ||
| bool doPixelUpscale = doUpscale && (upscaleMethod.StartsWith("pixel-") || upscaleMethod.StartsWith("model-")); | ||
| bool doPidUpscale = doUpscale && upscaleMethod.StartsWith("pidmodel-"); | ||
| bool doSeedVR2Upscale = doUpscale && upscaleMethod.StartsWith("seedvr2model-"); |
Member
There was a problem hiding this comment.
seedvr is not an upscale model
| )); | ||
| // ================================================ Final Stage ================================================ | ||
| GroupFinalStage = new("Final Stage", Toggles: true, Open: false, OrderPriority: -2.5, Description: "An upscale applied after the base and refiner stages are done.\nUnlike the Refine/Upscale group, nothing samples over the result after, only whatever the upscaler does itself."); | ||
| FinalUpscale = Register<double>(new("Final Upscale", "How much to upscale by in the final stage.\nThis stacks on top of Refiner Upscale, so 1.5 refiner upscale and 2 final upscale is 3x total.", |
…s in Final Stage", "Adds native SeedVR2 support"
jtreminio
marked this pull request as ready for review
August 1, 2026 02:00
Contributor
Author
|
I did not add section, so base loras will apply. Let me know if that should go in this PR or a separate one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To be rebased once #1462 is merged