refactor: simplify stylePreset merge logic in StabilityAiImageOptions builder

Replaces redundant or conflicting stylePreset assignments with a single mergeOption call using runtime style and default stylePreset.

Signed-off-by: Jhzlo <kjh0010703@naver.com>
This commit is contained in:
Jhzlo
2025-05-16 02:17:25 +09:00
committed by Soby Chacko
parent 0147d3bd55
commit 2721c9e676

View File

@@ -130,14 +130,13 @@ public class StabilityAiImageModel implements ImageModel {
defaultOptions.getResponseFormat()))
.width(ModelOptionsUtils.mergeOption(runtimeOptions.getWidth(), defaultOptions.getWidth()))
.height(ModelOptionsUtils.mergeOption(runtimeOptions.getHeight(), defaultOptions.getHeight()))
.stylePreset(ModelOptionsUtils.mergeOption(runtimeOptions.getStyle(), defaultOptions.getStyle()))
// Always set the stability-specific defaults
.cfgScale(defaultOptions.getCfgScale())
.clipGuidancePreset(defaultOptions.getClipGuidancePreset())
.sampler(defaultOptions.getSampler())
.seed(defaultOptions.getSeed())
.steps(defaultOptions.getSteps())
.stylePreset(defaultOptions.getStylePreset());
.stylePreset(ModelOptionsUtils.mergeOption(runtimeOptions.getStyle(), defaultOptions.getStylePreset()));
if (runtimeOptions instanceof StabilityAiImageOptions) {
StabilityAiImageOptions stabilityOptions = (StabilityAiImageOptions) runtimeOptions;
// Handle Stability AI specific image options