diff --git a/src/main/kotlin/com/tondo/api/infrastructure/aws/bedrock/service/BedrockService.kt b/src/main/kotlin/com/tondo/api/infrastructure/aws/bedrock/service/BedrockService.kt index 824ea26..9344c42 100644 --- a/src/main/kotlin/com/tondo/api/infrastructure/aws/bedrock/service/BedrockService.kt +++ b/src/main/kotlin/com/tondo/api/infrastructure/aws/bedrock/service/BedrockService.kt @@ -157,17 +157,17 @@ class BedrockService( private fun buildStabilityRequest(request: BedrockImageRequest): Map { val body = mutableMapOf( "prompt" to request.prompt, - "mode" to "text-to-image", - "aspect_ratio" to "1:1", "output_format" to "png" ) - if (request.negativePrompt.isNotBlank()) { - body["negative_prompt"] = request.negativePrompt + if (request.referenceImageBase64 != null) { + body["mode"] = "image-to-image" + body["image"] = request.referenceImageBase64 + body["strength"] = 0.65 // Fine-tuning 을 위해 조정해야하는 파라미터. 0으로 가까울수록 Skeletal 이미지에 가깝게, 멀 수록 artistic. } - if (request.referenceImageBase64 != null) { - log.warn("Stability Core v1 does not support img2img. Reference image ignored.") + if (request.negativePrompt.isNotBlank()) { + body["negative_prompt"] = request.negativePrompt } return body diff --git a/src/main/kotlin/com/tondo/api/infrastructure/aws/bedrock/template/BedrockPromptTemplate.kt b/src/main/kotlin/com/tondo/api/infrastructure/aws/bedrock/template/BedrockPromptTemplate.kt index 5cbe582..2eea422 100644 --- a/src/main/kotlin/com/tondo/api/infrastructure/aws/bedrock/template/BedrockPromptTemplate.kt +++ b/src/main/kotlin/com/tondo/api/infrastructure/aws/bedrock/template/BedrockPromptTemplate.kt @@ -57,11 +57,16 @@ object BedrockPromptTemplate { // } fun createImageGenerationPrompt(voiceColor: String = "#97b6e1"): String { return """ - High-quality acrylic painting on canvas, - intricate Chladni pattern with geometric symmetry, - primary color palette of $voiceColor with deep contrasting shadows, - thick brushstroke texture, rhythmic pointillism, - modern abstract art style, 8k resolution, masterpiece. - """.trimIndent() + Sophisticated acrylic painting on textured canvas, + preserving the exact geometric Chladni pattern structure, + primary color $voiceColor with deep dark tones in shadow regions and vibrant bright tones in highlights, + colors structurally distributed along the geometric forms, + bold and dynamic composition, + fine acrylic brushstroke texture, + reinterpreted pointillism with flowing continuous lines instead of dots, + binary contrast of light and shadow, + symmetrical structure with rich thick paint texture, + smartphone wallpaper, 8k resolution, masterpiece + """.trimIndent() } } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 93e8a82..8f65323 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -2,4 +2,4 @@ spring: application: name: tondo-api profiles: - active: prod # 로컬 개발 환경을 기본으로 설정 (필요에 따라 prod, test 등으로 변경) + active: local # 로컬 개발 환경을 기본으로 설정 (필요에 따라 prod, test 등으로 변경)