Skip to content
Closed
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,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
Expand Down Expand Up @@ -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"
)
Expand All @@ -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"
)
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Loading