Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/tondo/api/dto/ArtworkCreateRequest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
)
Expand All @@ -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"
)
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ object BedrockPromptTemplate {
averageHz: Double,
averageTimbre: Double,
averageVolume: Double,
voiceColor: String = "#97b6e1" // 필요시 동적으로 주입할 수 있도록 기본값 파라미터화
voiceColor: String = "light blue" // 필요시 동적으로 주입할 수 있도록 기본값 파라미터화
): String {
return """
당신은 미디어 아트 페스티벌의 수석 도슨트입니다. 아래의 관람객 음성 추출 데이터와 이 파동을 시각화하기 위해 AI에 적용된 아트워크 스타일과 실제 적용된 이미지를 바탕으로 도슨트 해설을 작성해 주세요.
Expand Down Expand Up @@ -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()
}
}
Loading