@umituz/react-native-ai-generation-content 1.89.30 → 1.89.32
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 +1 -1
- package/src/domains/generation/index.ts +0 -4
- package/src/domains/generation/infrastructure/appearance-analysis.ts +1 -1
- package/src/domains/generation/infrastructure/couple-generation-builder.ts +9 -16
- package/src/domains/prompts/index.ts +0 -7
- package/src/infrastructure/utils/couple-input.util.ts +1 -1
- package/src/domains/prompts/domain/base/couple-utils.ts +0 -68
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-ai-generation-content",
|
|
3
|
-
"version": "1.89.
|
|
3
|
+
"version": "1.89.32",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -20,7 +20,6 @@ export type {
|
|
|
20
20
|
export type {
|
|
21
21
|
GenerationExecutor,
|
|
22
22
|
GenerationOptions,
|
|
23
|
-
ImageGenerationInput,
|
|
24
23
|
ImageGenerationOutput,
|
|
25
24
|
VideoGenerationInput,
|
|
26
25
|
VideoGenerationOutput,
|
|
@@ -54,16 +53,13 @@ export type {
|
|
|
54
53
|
AuthGateStepConfig,
|
|
55
54
|
CreditGateStepConfig,
|
|
56
55
|
PhotoUploadStepConfig,
|
|
57
|
-
TextInputStepConfig,
|
|
58
56
|
SelectionStepConfig,
|
|
59
|
-
PreviewStepConfig,
|
|
60
57
|
WizardStepConfig,
|
|
61
58
|
WizardFeatureConfig,
|
|
62
59
|
ScenarioBasedConfig,
|
|
63
60
|
UsePhotoUploadStateProps,
|
|
64
61
|
UsePhotoUploadStateReturn,
|
|
65
62
|
PhotoUploadConfig,
|
|
66
|
-
PhotoUploadTranslations,
|
|
67
63
|
UseWizardGenerationProps,
|
|
68
64
|
UseWizardGenerationReturn,
|
|
69
65
|
WizardScenarioData,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Vision analysis暂时禁用 - 返回空上下文。
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { refinePromptForCouple } from "
|
|
8
|
+
import { refinePromptForCouple } from "../../../infrastructure/utils/couple-input.util";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Fotoğrafları analiz eder ve appearance context string'i döndürür.
|
|
@@ -12,23 +12,16 @@
|
|
|
12
12
|
* - Mood filter generation
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
import type { GenerationTarget } from "../../../exports/presentation";
|
|
15
16
|
import {
|
|
16
17
|
resolveCoupleInput,
|
|
17
18
|
prependContext,
|
|
18
19
|
refinePromptForCouple,
|
|
19
|
-
|
|
20
|
-
} from "
|
|
20
|
+
} from "../../../infrastructure/utils/couple-input.util";
|
|
21
|
+
import type { GenerationTargetLike } from "../../../infrastructure/utils/couple-input.util";
|
|
22
|
+
import { createPhotorealisticPrompt } from "../../prompts";
|
|
21
23
|
import { getAppearanceContext } from "./appearance-analysis";
|
|
22
24
|
|
|
23
|
-
/**
|
|
24
|
-
* Generation target configuration
|
|
25
|
-
* TODO: Import from app config when available
|
|
26
|
-
*/
|
|
27
|
-
const GENERATION_TARGETS = {
|
|
28
|
-
imageCoupleMultiRef: { model: "p-image-edit", providerId: "pruna" },
|
|
29
|
-
imageSingleEdit: { model: "p-image-edit", providerId: "pruna" },
|
|
30
|
-
} as const;
|
|
31
|
-
|
|
32
25
|
/**
|
|
33
26
|
* Couple generation input parameters
|
|
34
27
|
*/
|
|
@@ -49,7 +42,7 @@ export interface CoupleGenerationInputParams {
|
|
|
49
42
|
* Couple generation result
|
|
50
43
|
*/
|
|
51
44
|
export interface CoupleGenerationInput {
|
|
52
|
-
target:
|
|
45
|
+
target: GenerationTargetLike;
|
|
53
46
|
prompt: string;
|
|
54
47
|
params: Record<string, unknown>;
|
|
55
48
|
}
|
|
@@ -122,8 +115,8 @@ export async function buildCoupleGenerationInput(
|
|
|
122
115
|
partner1PhotoUri,
|
|
123
116
|
partner2PhotoUri,
|
|
124
117
|
isCoupleMode,
|
|
125
|
-
|
|
126
|
-
|
|
118
|
+
{ model: "p-image-edit", providerId: "pruna" }, // Single target
|
|
119
|
+
{ model: "p-image-edit", providerId: "pruna" }, // Couple target
|
|
127
120
|
);
|
|
128
121
|
|
|
129
122
|
// 6. BUILD PARAMS - Wardrobe formatında
|
|
@@ -186,8 +179,8 @@ export async function buildScenarioGenerationInput(
|
|
|
186
179
|
partner1PhotoUri,
|
|
187
180
|
partner2PhotoUri,
|
|
188
181
|
isCoupleMode,
|
|
189
|
-
|
|
190
|
-
|
|
182
|
+
{ model: "p-image-edit", providerId: "pruna" }, // Single target
|
|
183
|
+
{ model: "p-image-edit", providerId: "pruna" }, // Couple target
|
|
191
184
|
);
|
|
192
185
|
|
|
193
186
|
// 5. BUILD PARAMS - Scenario formatında
|
|
@@ -22,10 +22,3 @@ export {
|
|
|
22
22
|
|
|
23
23
|
export type { CreatePromptOptions } from './domain/base/types';
|
|
24
24
|
|
|
25
|
-
// Couple Utilities
|
|
26
|
-
export {
|
|
27
|
-
refinePromptForCouple,
|
|
28
|
-
prependContext,
|
|
29
|
-
resolveCoupleInput,
|
|
30
|
-
type ResolveCoupleInputResult,
|
|
31
|
-
} from './domain/base/couple-utils';
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Couple Prompt Utilities
|
|
3
|
-
*
|
|
4
|
-
* Çift prompt oluşturma utility'leri.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { CreatePromptOptions } from "./types";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Refine prompt for couple mode
|
|
11
|
-
*
|
|
12
|
-
* Çift modu için prompt'u iyileştirir.
|
|
13
|
-
*/
|
|
14
|
-
export function refinePromptForCouple(
|
|
15
|
-
prompt: string,
|
|
16
|
-
isCouple: boolean,
|
|
17
|
-
): string {
|
|
18
|
-
if (!isCouple) return prompt;
|
|
19
|
-
|
|
20
|
-
// Add couple-specific enhancements
|
|
21
|
-
const couplePrefix =
|
|
22
|
-
"COUPLE ENHANCEMENT: Both individuals should be clearly visible and harmoniously positioned in the frame. Preserve each person's unique appearance while creating a unified couple composition.";
|
|
23
|
-
|
|
24
|
-
return `${couplePrefix}\n\n${prompt}`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Prepend context to prompt
|
|
29
|
-
*
|
|
30
|
-
* Context bilgilerini prompt'un başına ekler.
|
|
31
|
-
*/
|
|
32
|
-
export function prependContext(
|
|
33
|
-
prompt: string,
|
|
34
|
-
context: string,
|
|
35
|
-
): string {
|
|
36
|
-
if (!context) return prompt;
|
|
37
|
-
return `${context}\n\n${prompt}`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Resolve couple input parameters
|
|
42
|
-
*
|
|
43
|
-
* Çift modu için doğru input parametrelerini belirler.
|
|
44
|
-
*/
|
|
45
|
-
export interface ResolveCoupleInputResult {
|
|
46
|
-
target: string;
|
|
47
|
-
imageUrls: string[];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function resolveCoupleInput(
|
|
51
|
-
partner1PhotoUri: string,
|
|
52
|
-
partner2PhotoUri: string | null,
|
|
53
|
-
isCoupleMode: boolean,
|
|
54
|
-
singleTarget: string,
|
|
55
|
-
coupleTarget: string,
|
|
56
|
-
): ResolveCoupleInputResult {
|
|
57
|
-
const imageUrls =
|
|
58
|
-
isCoupleMode && partner2PhotoUri
|
|
59
|
-
? [partner1PhotoUri, partner2PhotoUri]
|
|
60
|
-
: [partner1PhotoUri];
|
|
61
|
-
|
|
62
|
-
const target = isCoupleMode && partner2PhotoUri ? coupleTarget : singleTarget;
|
|
63
|
-
|
|
64
|
-
return {
|
|
65
|
-
target,
|
|
66
|
-
imageUrls,
|
|
67
|
-
};
|
|
68
|
-
}
|