feat: photoMaker in imageInference, IIpAdapter (guideImages, etc.), IEmbedding weight, dict coercion for nested options#251
feat: photoMaker in imageInference, IIpAdapter (guideImages, etc.), IEmbedding weight, dict coercion for nested options#251Sirsho1997 wants to merge 11 commits intomainfrom
Conversation
…Embedding weight, dict coercion for nested options
There was a problem hiding this comment.
Pull request overview
This PR extends the image inference request types and request-building flow to support PhotoMaker settings as a nested object, expands IP-Adapter options (including multi-image guidance), adds IEmbedding.weight, and adds dict/list coercion for several nested options inside IImageInference.
Changes:
- Added
IPhotoMakerSettingsandIImageInference.photoMaker, plus payload building and request wiring in the image-inference flow. - Expanded
IIpAdapterfields (includingguideImages) and added dict/list coercion foripAdaptersandembeddingsitems. - Added
IEmbedding.weightand consolidated PhotoMaker style validation into a shared_PHOTO_MAKER_VALID_STYLESconstant.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
runware/types.py |
Adds new/expanded request dataclasses and IImageInference.__post_init__ coercion to accept nested dicts/lists. |
runware/base.py |
Updates image-inference request building to process guideImages and include photoMaker payload in the request. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
runware/base.py:668
expected_resultsis set fromrequestPhotoMaker.numberResults, butIPhotoMaker.numberResultsis now optional and may beNone. That will break_handle_pending_operation_message(len(results) >= op["expected"]will raiseTypeError). DefaultnumberResultsto anint(e.g.,or 1) before registering the pending op (and ideally before putting it in the request payload).
future, should_send = await self._register_pending_operation(
task_uuid,
expected_results=numberOfResults,
complete_predicate=None,
result_filter=lambda r: r.get("imageUUID") is not None
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
teith
left a comment
There was a problem hiding this comment.
need also to fix the problems copilot found
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Added
Added photoMaker as a nested object in imageInference using IPhotoMakerSettings; IImageInference.photoMaker: Optional[Union[IPhotoMakerSettings, Dict[str, Any]]]. Nested settings use images/inputImages + style/strength. Standalone taskType="photoMaker" remains a separate operation via IPhotoMaker.
Added IIpAdapter.guideImages, combineMethod, weightType, embedScaling, weightComposition; guideImage optional; base supports guideImages with process_image.
Added IEmbedding.weight: Optional[float].
Added dict coercion in IImageInference.post_init for photoMaker, instantID, acePlusPlus, puLID, ultralytics, outpaint, refiner; list coercion for embeddings (dict → IEmbedding) and ipAdapters (dict → IIpAdapter).
Changed