Skip to content

feat: make ffi for same shap.#1635

Open
Cyberhan123 wants to merge 2 commits into
leejet:masterfrom
Cyberhan123:ffi-same-shape
Open

feat: make ffi for same shap.#1635
Cyberhan123 wants to merge 2 commits into
leejet:masterfrom
Cyberhan123:ffi-same-shape

Conversation

@Cyberhan123

@Cyberhan123 Cyberhan123 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

This is a supplement to the PR at #1633. The purpose is to ensure that the free image can correctly release all memory, so I think it is necessary to unify their return values ​​into pointers.

Why do this?
Because we have a unified API for free images, but upscale is excluded as an exception.

It was an optional PR, so I removed it and submitted it separately, but I felt it was necessary.

Checklist

Copilot AI review requested due to automatic review settings June 11, 2026 05:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the C/C++ upscaler API to return a pointer from upscale() and adjusts the CLI example to consume the new return type.

Changes:

  • Changed upscale() to return sd_image_t* instead of sd_image_t in the public header and implementation
  • Updated CLI example to dereference the returned sd_image_t* when constructing SDImageOwner

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/upscaler.cpp Changes upscale() implementation to return a pointer
include/stable-diffusion.h Updates the exported API signature for upscale()
examples/cli/main.cpp Adapts example usage to the new pointer return type

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/upscaler.cpp
Comment thread include/stable-diffusion.h
Comment thread examples/cli/main.cpp Outdated
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.

2 participants