Skip to content

refactor: remove redundant Builder.samples() method in StabilityAiImageOptions #3188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JHZLO
Copy link
Contributor

@JHZLO JHZLO commented May 15, 2025

Summary

This PR removes the samples(Integer samples) method from the StabilityAiImageOptions.Builder class, as it duplicates the existing N(Integer n) method.

Motivation

  • Both samples() and N() internally call setN(), which sets the same field (samples JSON property).
  • Having both methods introduces unnecessary redundancy and may cause confusion for users.
  • N() is already consistent with the ImageOptions.getN() interface method and commonly used throughout the codebase.

Additional Notes

If needed, developers can still set the samples value using the N() method:

StabilityAiImageOptions options = StabilityAiImageOptions.builder()
    .N(3)
    .build();

samples() duplicates N(), both setting the same field. Keeping only N() simplifies the builder API and aligns with ImageOptions.

Signed-off-by: Jhzlo <[email protected]>
@JHZLO JHZLO force-pushed the refactor-stability-ai branch from 269c310 to 690d89c Compare May 15, 2025 16:55
@markpollack markpollack added this to the 1.0.0 milestone May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants