Skip to content

Added async flow in imageUpscale, alias for IUpscaleSettings as ISettings#266

Merged
Sirsho1997 merged 3 commits intomainfrom
feature-addtargetMegapixelsParam
Apr 3, 2026
Merged

Added async flow in imageUpscale, alias for IUpscaleSettings as ISettings#266
Sirsho1997 merged 3 commits intomainfrom
feature-addtargetMegapixelsParam

Conversation

@Sirsho1997
Copy link
Copy Markdown
Collaborator

@Sirsho1997 Sirsho1997 commented Apr 1, 2026

Added

  • IImageUpscale: targetMegapixels, optional upscaleFactor, deliveryMethod (default "sync").
  • ISettings: image upscale fields (enhanceDetails, realism, and existing upscale tuning fields); IImageUpscale.settings typed as ISettings.
  • IUpscaleSettings as a deprecated subclass of ISettings (deprecation warning on use).
  • _upscaleGan: async deliveryMethod handling for IAsyncTaskResponse + polling.

Changed

  • _pollResults: imageUpscale, vectorize, and imageBackgroundRemoval resolve to IImage (fixes getResponse returning IVideo without image URLs).
  • _upscaleGan: conditional upscaleFactor / targetMegapixels; forward deliveryMethod.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for async delivery in imageUpscale, consolidates image upscaling settings into ISettings (with a deprecated IUpscaleSettings alias), and fixes polling/type resolution so image-based tasks return IImage results when using getResponse/polling.

Changes:

  • Extend IImageUpscale with targetMegapixels and deliveryMethod, and type settings as ISettings (with deprecated IUpscaleSettings).
  • Update _upscaleGan to support async acknowledgements (IAsyncTaskResponse) and to conditionally include upscaleFactor/targetMegapixels.
  • Update polling task-type mapping so imageUpscale, vectorize, and imageBackgroundRemoval resolve to IImage.

Reviewed changes

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

File Description
runware/types.py Moves upscale tuning fields into ISettings, adds deprecated IUpscaleSettings, and extends IImageUpscale with targetMegapixels + deliveryMethod.
runware/base.py Adds async deliveryMethod handling to _upscaleGan and updates _pollResults task-type mapping for image-returning tasks.

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

runware/base.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should be _retry_async_with_reconnect no?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch!

@Sirsho1997 Sirsho1997 merged commit c1dfc72 into main Apr 3, 2026
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.

3 participants