@umituz/react-native-ai-generation-content 1.17.169 → 1.17.171

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.17.169",
3
+ "version": "1.17.171",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -1,21 +1,11 @@
1
1
  /**
2
- * Image Prompt Segments
3
- * Reusable building blocks for composing AI image generation prompts
2
+ * Image Prompt Segments - Reusable building blocks for AI image prompts
4
3
  */
5
4
 
6
- // =============================================================================
7
- // IDENTITY PRESERVATION
8
- // =============================================================================
9
-
10
5
  export const IDENTITY_SEGMENTS = {
11
6
  samePerson: "same person",
12
- preserveIdentity: "preserve identity",
13
7
  preserveGender: "preserve original gender",
14
- preserveFace: "preserve original face structure",
15
- preserveHair: "preserve original hair color and style",
16
- preserveEyes: "preserve original eye color",
17
8
  sameFeatures: "same facial features",
18
- maintainLikeness: "maintain likeness",
19
9
  } as const;
20
10
 
21
11
  export const IDENTITY_NEGATIVE_SEGMENTS = {
@@ -25,11 +15,8 @@ export const IDENTITY_NEGATIVE_SEGMENTS = {
25
15
  changedIdentity: "changed identity",
26
16
  } as const;
27
17
 
28
- // =============================================================================
29
- // ANIME STYLE
30
- // =============================================================================
31
-
32
18
  export const ANIME_STYLE_SEGMENTS = {
19
+ animePortrait: "anime style portrait",
33
20
  base: "2D anime illustration",
34
21
  japaneseStyle: "japanese anime art style",
35
22
  celShaded: "cel-shaded anime character",
@@ -40,12 +27,10 @@ export const ANIME_STYLE_SEGMENTS = {
40
27
  vibrantColors: "vibrant anime colors",
41
28
  cleanLineart: "clean anime lineart",
42
29
  professionalPortrait: "professional anime portrait",
30
+ handDrawn: "hand drawn anime",
31
+ mangaStyle: "manga style",
43
32
  } as const;
44
33
 
45
- // =============================================================================
46
- // QUALITY
47
- // =============================================================================
48
-
49
34
  export const QUALITY_SEGMENTS = {
50
35
  highQuality: "high quality",
51
36
  detailed: "highly detailed",
@@ -64,10 +49,6 @@ export const QUALITY_NEGATIVE_SEGMENTS = {
64
49
  signature: "signature",
65
50
  } as const;
66
51
 
67
- // =============================================================================
68
- // REALISM AVOIDANCE (for stylized outputs)
69
- // =============================================================================
70
-
71
52
  export const ANTI_REALISM_SEGMENTS = {
72
53
  photorealistic: "photorealistic",
73
54
  realisticPhoto: "realistic photo",
@@ -79,10 +60,6 @@ export const ANTI_REALISM_SEGMENTS = {
79
60
  wrinkles: "wrinkles",
80
61
  } as const;
81
62
 
82
- // =============================================================================
83
- // ANATOMY NEGATIVE
84
- // =============================================================================
85
-
86
63
  export const ANATOMY_NEGATIVE_SEGMENTS = {
87
64
  deformedFace: "deformed face",
88
65
  badAnatomy: "bad anatomy",
@@ -92,17 +69,8 @@ export const ANATOMY_NEGATIVE_SEGMENTS = {
92
69
  missingFingers: "missing fingers",
93
70
  } as const;
94
71
 
95
- // =============================================================================
96
- // PRESET COLLECTIONS
97
- // =============================================================================
98
-
99
72
  export const PRESET_COLLECTIONS = {
100
- fullIdentityPreservation: Object.values(IDENTITY_SEGMENTS),
101
- basicIdentityPreservation: [
102
- IDENTITY_SEGMENTS.samePerson,
103
- IDENTITY_SEGMENTS.preserveGender,
104
- IDENTITY_SEGMENTS.preserveFace,
105
- ],
73
+ identityPreservation: Object.values(IDENTITY_SEGMENTS),
106
74
  animeStyle: Object.values(ANIME_STYLE_SEGMENTS),
107
75
  highQuality: Object.values(QUALITY_SEGMENTS),
108
76
  antiRealism: Object.values(ANTI_REALISM_SEGMENTS),
@@ -110,10 +78,6 @@ export const PRESET_COLLECTIONS = {
110
78
  identityNegative: Object.values(IDENTITY_NEGATIVE_SEGMENTS),
111
79
  } as const;
112
80
 
113
- // =============================================================================
114
- // TYPES
115
- // =============================================================================
116
-
117
81
  export type IdentitySegment = keyof typeof IDENTITY_SEGMENTS;
118
82
  export type AnimeStyleSegment = keyof typeof ANIME_STYLE_SEGMENTS;
119
83
  export type QualitySegment = keyof typeof QUALITY_SEGMENTS;
@@ -87,7 +87,7 @@ export { IDENTITY_SEGMENTS, IDENTITY_NEGATIVE_SEGMENTS, ANIME_STYLE_SEGMENTS, QU
87
87
  export type { IdentitySegment, AnimeStyleSegment, QualitySegment } from './domain/entities/image-prompt-segments';
88
88
 
89
89
  export { ImagePromptBuilder, createAnimeSelfiePrompt, createStyleTransferPrompt } from './infrastructure/services/ImagePromptBuilder';
90
- export type { ImagePromptResult, ImagePromptBuilderOptions } from './infrastructure/services/ImagePromptBuilder';
90
+ export type { ImagePromptResult, ImagePromptBuilderOptions, AnimeSelfiePromptResult } from './infrastructure/services/ImagePromptBuilder';
91
91
 
92
92
  export { DEFAULT_TEXT_TO_IMAGE_PROMPTS, DEFAULT_TEXT_TO_VOICE_PROMPTS } from './domain/entities/sample-prompts';
93
93
  export type { PromptSuggestion } from './domain/entities/sample-prompts';
@@ -1,114 +1,49 @@
1
+ /**
2
+ * Background Removal Service
3
+ * AI prompt generation for background removal tasks
4
+ */
5
+
1
6
  import type { IBackgroundRemovalService } from '../../domain/repositories/IAIPromptServices';
2
- import type {
3
- BackgroundRemovalConfig,
4
- } from '../../domain/entities/BackgroundRemovalConfig';
7
+ import type { BackgroundRemovalConfig } from '../../domain/entities/BackgroundRemovalConfig';
5
8
  import type { AIPromptTemplate } from '../../domain/entities/AIPromptTemplate';
6
- import type { AIPromptResult } from '../../domain/entities/types';
7
- import { createAIPromptTemplate } from '../../domain/entities/AIPromptTemplate';
8
- import {
9
- validateBackgroundRemovalConfig,
10
- getProcessingTime,
11
- getQualityScore
12
- } from '../../domain/entities/BackgroundRemovalConfig';
13
- import { PromptGenerationService } from '../services/PromptGenerationService';
14
-
15
- const createBackgroundRemovalBaseTemplate = (config?: {
16
- precision?: string;
17
- edgeRefinement?: boolean;
18
- }): string => {
19
- const {
20
- precision = 'accurate',
21
- edgeRefinement = true
22
- } = config || {};
9
+ import { validateBackgroundRemovalConfig, getProcessingTime, getQualityScore } from '../../domain/entities/BackgroundRemovalConfig';
10
+ import { BasePromptService } from './base';
23
11
 
24
- return `
12
+ const BASE_TEMPLATE = `
25
13
  You are an expert AI background removal specialist.
26
14
  This is a BACKGROUND REMOVAL task, not image generation.
27
15
 
28
- BACKGROUND REMOVAL OBJECTIVES:
29
- - Remove background with ${precision} precision
30
- - ${edgeRefinement ? 'Refine edges for clean cutout' : 'Focus on speed over precision'}
31
- - Preserve subject integrity and details
32
- - Create professional-quality transparency
33
-
34
16
  DETECTION PRINCIPLES:
35
17
  - Accurately identify foreground subject
36
18
  - Distinguish between subject and background
37
19
  - Handle complex edges (hair, fur, transparent objects)
38
20
  - Preserve fine details and textures
39
21
 
40
- TECHNICAL REQUIREMENTS:
41
- ${precision === 'ultra-accurate' ?
42
- `- Maximum precision processing
43
- - Advanced edge detection algorithms
44
- - Multiple refinement passes
45
- - Subpixel accuracy for edges` :
46
- precision === 'accurate' ?
47
- `- Standard precision processing
48
- - Reliable edge detection
49
- - Single refinement pass
50
- - Good balance of speed/quality` :
51
- `- Fast processing optimization
52
- - Basic edge detection
53
- - Quick subject isolation
54
- - Suitable for simple backgrounds`}
55
-
56
- EDGE HANDLING:
57
- ${edgeRefinement ?
58
- `- Feather edges naturally
59
- - Preserve hair and fine details
60
- - Remove halos and artifacts
61
- - Smooth transitions` :
62
- `- Focus on speed
63
- - Basic edge processing
64
- - Minimal refinement
65
- - Quick turnaround time`}
66
-
67
22
  SAFETY CONSTRAINTS:
68
23
  - Preserve subject completely
69
24
  - Do not alter foreground content
70
25
  - Maintain important details
71
26
  - Avoid over-removal of subject elements
72
-
73
- OUTPUT:
74
- Subject with transparent background,
75
- ready for compositing or new background application.
76
- `.trim();
77
- };
78
-
79
- export class BackgroundRemovalService implements IBackgroundRemovalService {
80
- private promptService: PromptGenerationService;
81
-
82
- constructor() {
83
- this.promptService = new PromptGenerationService();
27
+ `.trim();
28
+
29
+ export class BackgroundRemovalService
30
+ extends BasePromptService<BackgroundRemovalConfig>
31
+ implements IBackgroundRemovalService
32
+ {
33
+ protected getServiceName(): string {
34
+ return 'background removal';
84
35
  }
85
36
 
86
- generateTemplate(config: BackgroundRemovalConfig): Promise<AIPromptResult<AIPromptTemplate>> {
87
- try {
88
- if (!this.validateConfig(config)) {
89
- return Promise.resolve({
90
- success: false,
91
- error: 'VALIDATION_ERROR',
92
- message: 'Invalid background removal configuration'
93
- });
94
- }
37
+ validateConfig(config: BackgroundRemovalConfig): boolean {
38
+ return validateBackgroundRemovalConfig(config);
39
+ }
95
40
 
96
- const template = this.createBackgroundRemovalTemplate(config);
97
- return Promise.resolve({ success: true, data: template });
98
- } catch {
99
- return Promise.resolve({
100
- success: false,
101
- error: 'GENERATION_FAILED',
102
- message: 'Failed to generate background removal template'
103
- });
104
- }
41
+ estimateProcessingTime(config: BackgroundRemovalConfig): number {
42
+ return getProcessingTime(config.precision);
105
43
  }
106
44
 
107
- async generatePrompt(
108
- template: AIPromptTemplate,
109
- config: BackgroundRemovalConfig
110
- ): Promise<AIPromptResult<string>> {
111
- const variables = {
45
+ protected buildVariables(config: BackgroundRemovalConfig): Record<string, unknown> {
46
+ return {
112
47
  precision: config.precision,
113
48
  edgeRefinement: config.edgeRefinement,
114
49
  preserveHair: config.preserveHair,
@@ -117,93 +52,24 @@ export class BackgroundRemovalService implements IBackgroundRemovalService {
117
52
  processingTime: getProcessingTime(config.precision),
118
53
  qualityScore: getQualityScore(config),
119
54
  };
120
-
121
- return this.promptService.generateFromTemplate(template, variables);
122
55
  }
123
56
 
124
- validateConfig(config: BackgroundRemovalConfig): boolean {
125
- return validateBackgroundRemovalConfig(config);
126
- }
127
-
128
- estimateProcessingTime(config: BackgroundRemovalConfig): number {
129
- return getProcessingTime(config.precision);
130
- }
131
-
132
- private createBackgroundRemovalTemplate(config: BackgroundRemovalConfig): AIPromptTemplate {
133
- const templateId = `background-removal-${config.precision}`;
134
-
135
- const baseTemplate = createBackgroundRemovalBaseTemplate({
136
- precision: config.precision,
137
- edgeRefinement: config.edgeRefinement,
138
- });
139
-
140
- return createAIPromptTemplate({
141
- id: templateId,
57
+ protected createTemplate(config: BackgroundRemovalConfig): AIPromptTemplate {
58
+ return this.createTemplateWithDefaults({
59
+ id: `background-removal-${config.precision}`,
142
60
  name: `Background Removal: ${config.precision}`,
143
61
  description: `Remove background with ${config.precision} precision`,
144
62
  category: 'background-removal',
145
- template: `${baseTemplate}
146
-
147
- REMOVAL CONFIGURATION:
148
- - Precision Level: ${config.precision}
149
- - Edge Refinement: ${config.edgeRefinement}
150
- - Preserve Hair: ${config.preserveHair}
151
- - Output Format: ${config.outputFormat}
152
- ${config.addNewBackground ? `- New Background: ${config.addNewBackground}` : ''}
63
+ template: `${BASE_TEMPLATE}
153
64
 
154
- SPECIFIC REQUIREMENTS:
155
- ${this.getSpecificRequirements(config)}
65
+ PRECISION: ${config.precision}
66
+ EDGE REFINEMENT: ${config.edgeRefinement}
67
+ PRESERVE HAIR: ${config.preserveHair}
68
+ OUTPUT: ${config.outputFormat}
69
+ ${config.addNewBackground ? `NEW BACKGROUND: ${config.addNewBackground}` : ''}
156
70
 
157
- PROCESSING EXPECTATIONS:
158
- - Estimated Time: ${getProcessingTime(config.precision)} seconds
159
- - Quality Score: ${Math.round(getQualityScore(config) * 100)}%
160
- - Edge Detail: ${config.edgeRefinement ? 'High precision' : 'Standard precision'}
161
- - Hair Handling: ${config.preserveHair ? 'Preserved with detail' : 'Standard processing'}
162
-
163
- OUTPUT FORMAT:
164
- ${config.outputFormat === 'transparent' ? 'Transparent PNG with alpha channel' :
165
- config.outputFormat === 'png' ? 'PNG format with transparency' :
166
- 'WebP format with transparency support'}
167
-
168
- ${config.addNewBackground ? `NEW BACKGROUND:
169
- Replace removed background with: ${config.addNewBackground}
170
- Ensure proper blending and integration with subject.` : ''}
171
-
172
- EXPECTED RESULT:
173
- Clean subject with background removed,
174
- ${config.edgeRefinement ? 'with refined edges and preserved details' : 'with standard edge quality'},
175
- ready for ${config.outputFormat} output.
176
- `.trim(),
177
- variables: [],
178
- safety: {
179
- contentFilter: true,
180
- adultContentFilter: true,
181
- violenceFilter: true,
182
- hateSpeechFilter: true,
183
- copyrightFilter: true,
184
- },
185
- version: '1.0.0',
71
+ QUALITY: ${Math.round(getQualityScore(config) * 100)}%
72
+ EST. TIME: ${getProcessingTime(config.precision)}s`,
186
73
  });
187
74
  }
188
-
189
- private getSpecificRequirements(config: BackgroundRemovalConfig): string {
190
- const requirements: string[] = [];
191
-
192
- if (config.preserveHair) {
193
- requirements.push('- Advanced hair detection and preservation');
194
- requirements.push('- Fine strand handling and transparency');
195
- }
196
-
197
- if (config.edgeRefinement) {
198
- requirements.push('- Subpixel edge accuracy');
199
- requirements.push('- Natural feathering and anti-aliasing');
200
- }
201
-
202
- if (config.precision === 'ultra-accurate') {
203
- requirements.push('- Multi-pass refinement processing');
204
- requirements.push('- Advanced artifact removal');
205
- }
206
-
207
- return requirements.join('\n') || '- Standard background removal processing';
208
- }
209
- }
75
+ }
@@ -1,118 +1,61 @@
1
+ /**
2
+ * Colorization Service
3
+ * AI prompt generation for photo colorization
4
+ */
5
+
1
6
  import type { IColorizationService } from '../../domain/repositories/IAIPromptServices';
2
- import type {
3
- ColorizationConfig,
4
- } from '../../domain/entities/ColorizationConfig';
7
+ import type { ColorizationConfig } from '../../domain/entities/ColorizationConfig';
5
8
  import type { AIPromptTemplate } from '../../domain/entities/AIPromptTemplate';
6
- import type { AIPromptResult } from '../../domain/entities/types';
7
- import { createAIPromptTemplate } from '../../domain/entities/AIPromptTemplate';
8
9
  import {
9
10
  validateColorizationConfig,
10
11
  getColorizationQuality,
11
- getEraDescription,
12
- getSuggestedColorPalette
12
+ getSuggestedColorPalette,
13
13
  } from '../../domain/entities/ColorizationConfig';
14
- import { PromptGenerationService } from '../services/PromptGenerationService';
15
-
16
- const createColorizationBaseTemplate = (config?: {
17
- targetType?: string;
18
- colorMode?: string;
19
- }): string => {
20
- const {
21
- targetType = 'black-and-white',
22
- colorMode = 'realistic'
23
- } = config || {};
14
+ import { BasePromptService } from './base';
24
15
 
25
- return `
16
+ const BASE_TEMPLATE = `
26
17
  You are an expert AI colorization specialist.
27
18
  This is a PHOTO COLORIZATION task, not image generation.
28
19
 
29
- COLORIZATION OBJECTIVES:
30
- - Add appropriate colors to ${targetType} images
31
- - Apply ${colorMode} color treatment while preserving authenticity
32
- - Maintain original composition and details
33
- - Create natural, pleasing color relationships
34
-
35
20
  COLORIZATION PRINCIPLES:
36
21
  - Research appropriate color schemes for image era/content
37
22
  - Apply colors that match scene context and lighting
38
23
  - Preserve details and textures while adding color
39
- - Ensure color harmony and balance throughout image
40
-
41
- ${colorMode === 'realistic' ?
42
- `REALISTIC COLORIZATION:
43
- - Use historically accurate colors when appropriate
44
- - Consider natural lighting conditions
45
- - Apply realistic skin tones and environmental colors
46
- - Maintain photographic authenticity` :
47
- colorMode === 'vibrant' ?
48
- `VIBRANT COLORIZATION:
49
- - Use rich, saturated colors for visual impact
50
- - Create bold color contrasts and relationships
51
- - Apply artistic color interpretations
52
- - Enhance visual interest and appeal` :
53
- colorMode === 'artistic' ?
54
- `ARTISTIC COLORIZATION:
55
- - Apply creative color interpretations
56
- - Use expressive color choices and combinations
57
- - Create mood and atmosphere through color
58
- - Allow artistic freedom in color selection` :
59
- `VINTAGE COLORIZATION:
60
- - Use period-appropriate color palettes
61
- - Apply aged, authentic color treatments
62
- - Maintain historical color sensibilities
63
- - Create nostalgic, time-appropriate appearance`}
24
+ - Ensure color harmony and balance
64
25
 
65
- TECHNICAL REQUIREMENTS:
26
+ TECHNICAL:
66
27
  - Preserve edges and details during color application
67
28
  - Apply colors smoothly and naturally
68
29
  - Consider lighting and shadow relationships
69
- - Maintain image quality and resolution
70
30
 
71
- SAFETY CONSTRAINTS:
31
+ SAFETY:
72
32
  - Do not alter content or composition
73
33
  - Preserve important details and features
74
34
  - Avoid inappropriate or unrealistic colors
75
- - Maintain appropriate content standards
76
-
77
- OUTPUT:
78
- Beautifully colorized version of the original ${targetType} image,
79
- with ${colorMode} color treatment that enhances rather than dominates.
80
- `.trim();
81
- };
82
-
83
- export class ColorizationService implements IColorizationService {
84
- private promptService: PromptGenerationService;
35
+ `.trim();
36
+
37
+ export class ColorizationService
38
+ extends BasePromptService<ColorizationConfig>
39
+ implements IColorizationService
40
+ {
41
+ protected getServiceName(): string {
42
+ return 'colorization';
43
+ }
85
44
 
86
- constructor() {
87
- this.promptService = new PromptGenerationService();
45
+ validateConfig(config: ColorizationConfig): boolean {
46
+ return validateColorizationConfig(config);
88
47
  }
89
48
 
90
- generateTemplate(config: ColorizationConfig): Promise<AIPromptResult<AIPromptTemplate>> {
91
- try {
92
- if (!this.validateConfig(config)) {
93
- return Promise.resolve({
94
- success: false,
95
- error: 'VALIDATION_ERROR',
96
- message: 'Invalid colorization configuration'
97
- });
98
- }
49
+ getColorPalette(config: ColorizationConfig): string[] {
50
+ return getSuggestedColorPalette(config.targetType, config.colorMode);
51
+ }
99
52
 
100
- const template = this.createColorizationTemplate(config);
101
- return Promise.resolve({ success: true, data: template });
102
- } catch {
103
- return Promise.resolve({
104
- success: false,
105
- error: 'GENERATION_FAILED',
106
- message: 'Failed to generate colorization template'
107
- });
108
- }
53
+ getQualityScore(config: ColorizationConfig): number {
54
+ return getColorizationQuality(config);
109
55
  }
110
56
 
111
- async generatePrompt(
112
- template: AIPromptTemplate,
113
- config: ColorizationConfig
114
- ): Promise<AIPromptResult<string>> {
115
- const variables = {
57
+ protected buildVariables(config: ColorizationConfig): Record<string, unknown> {
58
+ return {
116
59
  targetType: config.targetType,
117
60
  colorMode: config.colorMode,
118
61
  preserveOriginal: config.preserveOriginal,
@@ -122,111 +65,26 @@ export class ColorizationService implements IColorizationService {
122
65
  qualityScore: getColorizationQuality(config),
123
66
  colorPalette: this.getColorPalette(config),
124
67
  };
125
-
126
- return this.promptService.generateFromTemplate(template, variables);
127
68
  }
128
69
 
129
- validateConfig(config: ColorizationConfig): boolean {
130
- return validateColorizationConfig(config);
131
- }
132
-
133
- getColorPalette(config: ColorizationConfig): string[] {
134
- return getSuggestedColorPalette(config.targetType, config.colorMode);
135
- }
70
+ protected createTemplate(config: ColorizationConfig): AIPromptTemplate {
71
+ const quality = Math.round(getColorizationQuality(config) * 100);
136
72
 
137
- getQualityScore(config: ColorizationConfig): number {
138
- return getColorizationQuality(config);
139
- }
140
-
141
- private createColorizationTemplate(config: ColorizationConfig): AIPromptTemplate {
142
- const templateId = `colorization-${config.targetType}-${config.colorMode}`;
143
-
144
- const baseTemplate = createColorizationBaseTemplate({
145
- targetType: config.targetType,
146
- colorMode: config.colorMode,
147
- });
148
-
149
- return createAIPromptTemplate({
150
- id: templateId,
73
+ return this.createTemplateWithDefaults({
74
+ id: `colorization-${config.targetType}-${config.colorMode}`,
151
75
  name: `Colorization: ${config.targetType} to ${config.colorMode}`,
152
76
  description: `Colorize ${config.targetType} images with ${config.colorMode} treatment`,
153
77
  category: 'colorization',
154
- template: `${baseTemplate}
155
-
156
- COLORIZATION CONFIGURATION:
157
- - Target Type: ${config.targetType}
158
- - Color Mode: ${config.colorMode}
159
- - Preserve Original: ${config.preserveOriginal}
160
- - Adjust Lighting: ${config.adjustLighting}
161
- - Skin Tone Preservation: ${config.skinTonePreservation}
162
- ${config.era ? `- Era: ${config.era}` : ''}
163
-
164
- COLOR REQUIREMENTS:
165
- ${this.getColorRequirements(config)}
78
+ template: `${BASE_TEMPLATE}
166
79
 
167
- ${config.era ? `ERA-SPECIFIC GUIDELINES:
168
- ${getEraDescription(config.era)}
80
+ TARGET: ${config.targetType}
81
+ MODE: ${config.colorMode}
82
+ PRESERVE ORIGINAL: ${config.preserveOriginal}
83
+ ADJUST LIGHTING: ${config.adjustLighting}
84
+ SKIN TONE PRESERVATION: ${config.skinTonePreservation}
85
+ ${config.era ? `ERA: ${config.era}` : ''}
169
86
 
170
- ` : ''}QUALITY EXPECTATIONS:
171
- - Quality Score: ${Math.round(getColorizationQuality(config) * 100)}%
172
- - Color Mode: ${config.colorMode} treatment applied
173
- - Preserved Elements: ${config.preserveOriginal ? 'Original content preserved' : 'Enhanced interpretation'}
174
- - Skin Handling: ${config.skinTonePreservation ? 'Natural tones preserved' : 'Artistic interpretation allowed'}
175
-
176
- ${this.getColorPalette(config).length > 0 ? `
177
- SUGGESTED COLOR PALETTE:
178
- ${this.getColorPalette(config).join(', ')}
179
-
180
- ` : ''}EXPECTED RESULT:
181
- Professionally colorized ${config.targetType} image,
182
- with ${config.colorMode} color treatment,
183
- ${config.skinTonePreservation ? 'maintaining natural appearance' : 'allowing artistic interpretation'}.
184
- `.trim(),
185
- variables: [],
186
- safety: {
187
- contentFilter: true,
188
- adultContentFilter: true,
189
- violenceFilter: true,
190
- hateSpeechFilter: true,
191
- copyrightFilter: true,
192
- },
193
- version: '1.0.0',
87
+ QUALITY: ${quality}%`,
194
88
  });
195
89
  }
196
-
197
- private getColorRequirements(config: ColorizationConfig): string {
198
- const requirements: string[] = [];
199
-
200
- if (config.targetType === 'black-and-white') {
201
- requirements.push('- Add natural colors to monochrome image');
202
- requirements.push('- Consider original grayscale values for color mapping');
203
- }
204
-
205
- if (config.targetType === 'sepia') {
206
- requirements.push('- Refresh and enhance sepia-toned image');
207
- requirements.push('- Maintain vintage character while adding color');
208
- }
209
-
210
- if (config.colorMode === 'realistic') {
211
- requirements.push('- Use historically and naturally accurate colors');
212
- requirements.push('- Apply appropriate skin tones and environmental colors');
213
- }
214
-
215
- if (config.colorMode === 'vibrant') {
216
- requirements.push('- Use rich, saturated colors for visual impact');
217
- requirements.push('- Create bold color contrasts and relationships');
218
- }
219
-
220
- if (config.adjustLighting) {
221
- requirements.push('- Adjust colors for optimal lighting conditions');
222
- requirements.push('- Ensure appropriate contrast and brightness');
223
- }
224
-
225
- if (config.skinTonePreservation) {
226
- requirements.push('- Maintain natural, appropriate skin tones');
227
- requirements.push('- Avoid unrealistic or inappropriate skin colors');
228
- }
229
-
230
- return requirements.join('\n') || '- Apply appropriate color treatment based on configuration';
231
- }
232
- }
90
+ }