diff --git a/src/main/kotlin/com/tondo/api/application/ArtworkOrchestrator.kt b/src/main/kotlin/com/tondo/api/application/ArtworkOrchestrator.kt index e714ba0..4552fd9 100644 --- a/src/main/kotlin/com/tondo/api/application/ArtworkOrchestrator.kt +++ b/src/main/kotlin/com/tondo/api/application/ArtworkOrchestrator.kt @@ -67,7 +67,7 @@ class ArtworkOrchestrator( val artworkRepresentation = try { ArtworkRepresentation( averageHz = request.averageHz, - averageVolume = request.averageVolulme, + averageVolume = request.averageVolume, averageTimbre = request.averageTimbre, base64Image = Base64.getDecoder().decode(request.base64Image), voiceColor = request.voiceColor diff --git a/src/main/kotlin/com/tondo/api/dto/ArtworkCreateRequest.kt b/src/main/kotlin/com/tondo/api/dto/ArtworkCreateRequest.kt index 5e0928a..81785b5 100644 --- a/src/main/kotlin/com/tondo/api/dto/ArtworkCreateRequest.kt +++ b/src/main/kotlin/com/tondo/api/dto/ArtworkCreateRequest.kt @@ -6,7 +6,7 @@ package com.tondo.api.dto data class ArtworkCreateRequest( val uuid: String, val averageHz: Double, - val averageVolulme: Double, + val averageVolume: Double, val averageTimbre: Double, val base64Image: String, // 이 필드의 크기가 클 수 있습니다! JSON 페이로드 크기 보고, request body size limit 늘려야할 수 있습니다! val voiceColor: String // 음색의 HEX CODE 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 8f2ee99..b35fd6a 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 @@ -7,6 +7,8 @@ import com.tondo.api.infrastructure.aws.bedrock.dto.BedrockImageRequest import com.tondo.api.infrastructure.aws.bedrock.dto.BedrockMessage import com.tondo.api.infrastructure.aws.bedrock.dto.BedrockRequest import com.tondo.api.infrastructure.aws.bedrock.template.BedrockPromptTemplate +import com.tondo.api.infrastructure.aws.bedrock.template.BedrockPromptTemplate.createImageGenerationPrompt +import com.tondo.api.infrastructure.aws.bedrock.template.BedrockPromptTemplate.createNegativePrompt import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Qualifier import org.springframework.context.annotation.Profile @@ -132,8 +134,6 @@ class BedrockService( "similarityStrength" to 0.7 ), "imageGenerationConfig" to mapOf( - "width" to request.width, - "height" to request.height, "numberOfImages" to 1, "quality" to "standard" ) @@ -145,8 +145,6 @@ class BedrockService( "text" to request.prompt ), "imageGenerationConfig" to mapOf( - "width" to request.width, - "height" to request.height, "numberOfImages" to 1, "quality" to "standard" ) @@ -162,9 +160,11 @@ class BedrockService( if (request.referenceImageBase64 != null) { body["mode"] = "image-to-image" + body["negative_prompt"] = createNegativePrompt() body["image"] = request.referenceImageBase64 - body["strength"] = 0.50 // Fine-tuning 을 위해 조정해야하는 파라미터. 0으로 가까울수록 Skeletal 이미지에 가깝게, 멀 수록 artistic. - } + body["strength"] = 0.62 + body["seed"] = 0 + } if (request.negativePrompt.isNotBlank()) { body["negative_prompt"] = request.negativePrompt 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 2eea422..ea8b8d5 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 @@ -54,19 +54,46 @@ object BedrockPromptTemplate { // Convert fine points into flowing, continuous lines with a binary contrast of light and shadow. // Ensure a perfect harmony between symmetrical structure and rich, thick paint texture. // """.trimIndent() +// } +// fun createImageGenerationPrompt(voiceColor: String = "#97b6e1"): String { +// return """ +// 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() // } fun createImageGenerationPrompt(voiceColor: String = "#97b6e1"): String { return """ - 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() + A luxurious acrylic oil painting on textured canvas, + depicting the flowing wave pattern from the reference image, + thick impasto brushstrokes, palette knife texture, + visible canvas weave, rich layered pigment, tactile surface, + + dominant color palette built around $voiceColor, + harmonious tonal variations from deep shadow to bright highlight of this hue, + painterly gradients following the wave ridges, + + museum-quality fine art, gallery piece, + dramatic chiaroscuro lighting on paint texture, + ultra detailed brush fibers, 8k, smartphone wallpaper composition + """.trimIndent() + } + + fun createNegativePrompt(): String { + return """ + sand particles, dots, pointillism, halftone, dotted pattern, + photorealistic, photograph, 3d render, CGI, smooth plastic surface, + flat illustration, vector art, digital art, + dark background, black background, low contrast, + geometric shapes, mandala, kaleidoscope, radial symmetry, + text, watermark, signature, blurry, low quality + """.trimIndent() } }