Skip to content

fix: honor --conv-direct for ESRGAN upscaler (#2163) - #2171

Draft
Vamsi-2581 wants to merge 4 commits into
leejet:masterfrom
Vamsi-2581:codex/upscaler-conv-direct-2163
Draft

Vamsi-2581 wants to merge 4 commits into
leejet:masterfrom
Vamsi-2581:codex/upscaler-conv-direct-2163

Conversation

@Vamsi-2581

@Vamsi-2581 Vamsi-2581 commented Oct 20, 2026 •

Copy link
Copy Markdown

Summary

  • Add upscaler=on|off to --conv-direct for the standalone ESRGAN upscaler.
  • Preserve --diffusion-conv-direct behavior when --conv-direct is omitted, and apply the setting in both CLI and server paths.
  • Update CLI help, documentation, and deprecated-option guidance.

Closes #2163.

Review follow-up

The latest commits address the maintainer's concern about examples calling core/ internals: the example now parses the assignment locally. Please review the updated parser and behavior, then re-review this PR.

Verification

Not run in this cloud workflow. The repository contribution guide says not to include test code in PRs. Human review of the updated implementation and the remaining CI check is pending.

AI assistance: OpenAI Codex assisted with implementation and review. Human review is pending.

Parse explicit upscaler convolution assignments and apply them when the CLI or server creates the ESRGAN context. Preserve the legacy diffusion flag fallback, and document the assignment.

Signed-off-by: Vamsi-1 <245859299+Vamsi-2581@users.noreply.github.com>
Assisted-by: OpenAI Codex
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread examples/common/common.cpp Resolved
@vmobilis

Copy link
Copy Markdown
Contributor

@Vamsi-2581, hello, maybe the parser could use same logic as for other conv-direct options, that is:

  1. --conv-direct is checked for correctness of syntax with others in common.cpp#L750 and put into conv_direct_mode;
  2. the conv_direct_mode is parsed into conv_direct_assignment in diffusion_engine.cpp#L918;
  3. each module gets its own conv-direct flag in diffusion_engine.cpp#L1227.

@Vamsi-2581

Copy link
Copy Markdown
Author

Thanks, the shared assignment path makes sense for runners initialized by StableDiffusionGGML. The ESRGAN upscaler here is created separately through new_upscaler_ctx, outside diffusion_engine.cpp, and the earlier review specifically asked examples not to call core internals. How would you prefer the standalone context to receive the parsed upscaler setting: should this be exposed through a public parameter/helper, or do you have another intended route? I’m holding this follow-up until I align with that boundary.

@vmobilis

vmobilis commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

@Vamsi-2581, since the upscaler is running after the generation, maybe just set inside diffusion_engine.cpp the ctx_params.upscaler_conv_direct flag, and it can later be checked by the upscaler module.

And for upscale mode, skip all generation runners and parse conv-direct option only to configure ctx_params.upscaler_conv_direct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] deprecated --diffusion-conv-direct still controls the upscaler

3 participants