feat: move circular padding to per-generation params#1748
Merged
Conversation
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.
Summary
Moves the
circular_x/circular_yflags fromsd_ctx_params_ttosd_img_gen_params_tandsd_vid_gen_params_t. Previously users had to unload and reload the model to switch between tileable and non-tileable output; now they can vary it per generate call on a persistent context.The setter
set_circular_axesis just two bool assignments on the runner context, and the VAE encode/decode entry points already takecircular_x/circular_yas function arguments, so nothing about the plumbing required a load-time decision.Related Issue / Discussion
None.
Additional Information
Behavior verified
Loaded AcornXL_V2 (SDXL) once, ran two consecutive generations of "seamless tiling brick wall texture, flat lighting" at 512x512, 20 steps, karras, seed 42:
--circular: log showsUsing circular padding for convolutions (x=true, y=true), output has wrapped edges.Same executable, same code path, no reload.
Changes
sd_ctx_params_t: droppedcircular_x,circular_y(default init, param string, and print). Load-timeset_circular_axescalls inStableDiffusionGGML::load_from_fileremoved.sd_img_gen_params_t,sd_vid_gen_params_t: appendedcircular_x,circular_y; wired defaults in_initand printing insd_img_gen_params_to_str.apply_circular_axes_to_diffusion(sd_ctx, cx, cy)invoked at the top ofgenerate_image/generate_video. Sets the sd struct fields (so the existing VAE guard picks them up) and callsset_circular_axesondiffusion_model,high_noise_diffusion_model, andcontrol_net. Logs only when a flag is on.--circular,--circularx,--circularymoved fromSDParamstoSDGenerationParams; assignment routed tosd_img_gen_params_t/sd_vid_gen_params_tinto_sd_img_gen_params_tandto_sd_vid_gen_params_t.Notes
configure_image_vae_axes) continues to readsd_ctx->sd->circular_x/y. Those are now set from gen params at generate-time, one line before the guard runs.Checklist