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..a90da9e 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,7 @@ 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.createNegativePrompt import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Qualifier import org.springframework.context.annotation.Profile @@ -132,8 +133,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 +144,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 +159,10 @@ 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.65 + } 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..38c697c 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 @@ -13,7 +13,7 @@ object BedrockPromptTemplate { averageHz: Double, averageTimbre: Double, averageVolume: Double, - voiceColor: String = "#97b6e1" // 필요시 동적으로 주입할 수 있도록 기본값 파라미터화 + voiceColor: String = "light blue" // 필요시 동적으로 주입할 수 있도록 기본값 파라미터화 ): String { return """ 당신은 미디어 아트 페스티벌의 수석 도슨트입니다. 아래의 관람객 음성 추출 데이터와 이 파동을 시각화하기 위해 AI에 적용된 아트워크 스타일과 실제 적용된 이미지를 바탕으로 도슨트 해설을 작성해 주세요. @@ -55,18 +55,55 @@ object BedrockPromptTemplate { // Ensure a perfect harmony between symmetrical structure and rich, thick paint texture. // """.trimIndent() // } - fun createImageGenerationPrompt(voiceColor: String = "#97b6e1"): String { +// 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 = "light blue"): String { + return """ + $voiceColor monochromatic painting, strict $voiceColor color scheme only, + + redraw the Chladni figure pattern from the reference image, + preserve the exact geometric sand ripple lines and nodal curves, + symmetric geometric wave interference pattern, + fine granular lines forming geometric shapes, + + luxurious acrylic oil painting on textured canvas, + thick impasto brushstrokes, palette knife texture, + visible canvas weave, rich layered pigment, tactile surface, + + dark $voiceColor background, bright $voiceColor pattern lines, + deep $voiceColor in shadows, bright $voiceColor in highlights, + every brushstroke and pigment in shades of $voiceColor only, + NO other dominant colors except $voiceColor variations, + + 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 """ - 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() + 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() } }