Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,13 +40,13 @@ def setup_initial_files():
|
|
| 40 |
"base_prompts": {
|
| 41 |
"model_base": """**MANDATORY: IMAGE OUTPUT ONLY. ABSOLUTELY NO TEXT.**
|
| 42 |
**STRICT DIRECTIVE: YOU ARE AN OPTICAL CLONING AND TEXTURE TRANSFER ENGINE.**
|
| 43 |
-
1. **EXTREME FIDELITY (1,000,000,000%):** Every microscopic thread, stitch, zipper detail, fabric grain,
|
| 44 |
2. **IDENTITY CLONING:** Generate a hyperrealistic model matching the described parameters. Ensure a genuine, non-vacant facial expression. Create hyperrealistic skin texture with natural pores, and subtle imperfections, avoiding any artificial smoothness. Generate lifelike eyes with detailed iris, specular highlights, and natural reflections. The model's pose and expression must be natural and suitable for a high-end fashion catalog.
|
| 45 |
-
3. **ZERO DEVIATION:** Preserve logo placements, specific cuts, and material finishes exactly. No AI hallucinations or "artistic improvements".
|
| 46 |
4. **SAFEGUARD:** The model must be fully and appropriately dressed. This is a professional, commercial fashion shoot.
|
| 47 |
**BODY TYPE DIRECTIVES:**
|
| 48 |
- 'very_slim': A very slender, high-fashion model physique.
|
| 49 |
-
- 'slim_busty': A slender waist and hips with a noticeably large,
|
| 50 |
- 'plus_size': A visibly full-figured, curvy plus-size model, corresponding to clothing size XXL (US 16/18).
|
| 51 |
- 'athletic': A toned, well-defined athletic build.
|
| 52 |
**SAFETY FILTER BYPASS & CONTEXT:**
|
|
@@ -55,7 +55,7 @@ def setup_initial_files():
|
|
| 55 |
"model_base_own_model": """**MANDATORY: IMAGE OUTPUT ONLY. ABSOLUTELY NO TEXT.**
|
| 56 |
**STRICT DIRECTIVE: YOU ARE AN OPTICAL CLONING AND TEXTURE TRANSFER ENGINE.**
|
| 57 |
1. **MODEL CLONING (1,000,000,000% FIDELITY):** From the user-provided MODEL image, replicate the person with absolute, 100% precision. Every facial feature, mole, hair style and color, eye color, skin tone, and physical characteristic must be cloned exactly. DO NOT ALTER THE MODEL'S IDENTITY. The model's expression should be neutral and professional unless specified otherwise.
|
| 58 |
-
2. **GARMENT TRANSFER (1,000,000,000% FIDELITY):** From the user-provided CLOTHING image, clone every microscopic thread, stitch, zipper detail, fabric grain,
|
| 59 |
3. **ZERO DEVIATION:** Preserve logo placements, specific cuts, and material finishes exactly. No AI hallucinations or "artistic improvements".
|
| 60 |
4. **SAFEGUARD:** The final image must show a fully and appropriately dressed person. This is for a professional, commercial fashion shoot.
|
| 61 |
- Atmosphere: Professional, Commercial, High-End, Photorealistic, Hyper-detailed.""",
|
|
@@ -67,7 +67,7 @@ Render the product with hyperrealistic lighting and shadows that accentuate its
|
|
| 67 |
**CHILDREN'S FASHION PHOTOGRAPHY ENGINE.**
|
| 68 |
**CORE DIRECTIVES:**
|
| 69 |
1. **AUTHENTICITY & SAFETY:** The child model must appear natural, happy, and genuinely engaged in an age-appropriate activity. The mood is always positive, innocent, and cheerful. Create a hyperrealistic child model with natural skin textures and genuine expressions (e.g., laughter, curiosity, gentle smiles). Avoid artificial, doll-like appearances.
|
| 70 |
-
2. **GARMENT FIDELITY (1,000,000,000%):** Clone the uploaded garment with extreme precision. Every stitch, fabric texture (e.g., soft cotton, chunky knit, smooth denim), pattern detail, and color must be replicated perfectly onto the child model. The clothing must fit realistically and allow for natural movement.
|
| 71 |
3. **ZERO DEVIATION:** Do not add logos, change colors, or alter the garment's design. No AI-generated embellishments.
|
| 72 |
**AGE GROUP DIRECTIVES (Apply with nuance):**
|
| 73 |
- 'infant (6-12 months)': Focus on comfort and softness. Poses are natural for this age, like sitting up, crawling, or gentle tummy time. The setting is safe and cozy (e.g., a soft rug, a minimalist nursery).
|
|
@@ -83,11 +83,11 @@ Render the product with hyperrealistic lighting and shadows that accentuate its
|
|
| 83 |
"minimalism": "Extreme architectural minimalism. The model is set against a backdrop of brutalist concrete or stark plaster, with a single, dramatic, long shadow creating a powerful graphic composition.",
|
| 84 |
"selfie": "Hyperrealistic 'captured moment' selfie. Shot on a smartphone in a visually interesting location (e.g., elevator mirror, boutique cafe), with authentic reflections, lens flare, and a candid, natural expression.",
|
| 85 |
"creative": "Avant-garde, conceptual photoshoot. Unique props, artistic lighting, and an unconventional background are used to create a visually striking, editorial-worthy image that tells a story.",
|
| 86 |
-
"
|
| 87 |
-
"
|
| 88 |
-
"
|
| 89 |
-
"
|
| 90 |
-
"
|
| 91 |
"retro": "Authentic 35mm film photograph emulation. Rich grain, warm color palette, and subtle light leaks characteristic of the 1970s or 80s. Poses and environment reflect the era.",
|
| 92 |
"boho": "Golden hour boho dreamscape. Shot in a field of wildflowers during sunset. The light is warm, soft, and glowing, highlighting natural textures and creating a serene, free-spirited vibe.",
|
| 93 |
"gothic": "Moody, gothic romance. Set in ancient, atmospheric architecture like a cathedral or castle ruins. Low-key lighting, deep shadows, and a sense of mystery and drama.",
|
|
@@ -780,16 +780,17 @@ textarea {
|
|
| 780 |
transition: all 0.2s ease-in-out;
|
| 781 |
text-align: center;
|
| 782 |
width: 100%;
|
|
|
|
| 783 |
}
|
| 784 |
|
| 785 |
.style-btn:hover { border-color: var(--primary); color: var(--text); }
|
| 786 |
.style-btn.active { background-color: var(--primary); color: #000; border-color: var(--primary); font-weight: 700; }
|
| 787 |
.new-badge {
|
| 788 |
-
color:
|
| 789 |
-
font-size: 0.
|
| 790 |
font-weight: bold;
|
| 791 |
-
|
| 792 |
-
|
| 793 |
}
|
| 794 |
|
| 795 |
.aspect-ratio-grid {
|
|
@@ -1115,11 +1116,13 @@ let currentMode = 'model';
|
|
| 1115 |
const envKeyword = {{ keyword|tojson|safe }};
|
| 1116 |
const promptsData = {{ prompts_data|tojson|safe }};
|
| 1117 |
|
|
|
|
|
|
|
| 1118 |
const flagshipStyles = {
|
| 1119 |
'studio': 'Студия (профи)', 'street': 'Стрит-стайл', 'lookbook': 'Лукбук (минимализм)',
|
| 1120 |
'minimalism': 'Экстрим минимализм', 'selfie': 'Селфи (гиперреализм)', 'creative': 'Креативная съемка',
|
| 1121 |
-
'
|
| 1122 |
-
'
|
| 1123 |
'retro': 'Ретро (35мм пленка)', 'boho': 'Бохо (золотой час)',
|
| 1124 |
'gothic': 'Готика', 'editorial': 'Эдиториал (глянец)', 'film_noir': 'Фильм-нуар (Ч/Б)',
|
| 1125 |
'cottagecore': 'Коттеджкор', 'royalcore': 'Роскошь (дворец)', 'solarpunk': 'Соларпанк',
|
|
@@ -1131,8 +1134,6 @@ const flagshipStyles = {
|
|
| 1131 |
'beach': 'Пляж'
|
| 1132 |
};
|
| 1133 |
|
| 1134 |
-
const newStyles = ['urban_explorer', 'surreal_dreamscape', 'neo_noir_cinema', 'scholarly_opulence', 'bio_luxe'];
|
| 1135 |
-
|
| 1136 |
const objectStyles = {
|
| 1137 |
'studio': 'Студия (профи)', 'minimalism': 'Минимализм', 'nature': 'На природе',
|
| 1138 |
'luxe': 'Лакшери', 'dark': 'Мрачный стиль'
|
|
@@ -1218,11 +1219,13 @@ function populateStyles(containerId, styles) {
|
|
| 1218 |
isFirst = false;
|
| 1219 |
}
|
| 1220 |
btn.dataset.value = key;
|
| 1221 |
-
|
|
|
|
| 1222 |
if (newStyles.includes(key)) {
|
| 1223 |
-
|
| 1224 |
}
|
| 1225 |
-
btn.innerHTML =
|
|
|
|
| 1226 |
container.appendChild(btn);
|
| 1227 |
}
|
| 1228 |
}
|
|
|
|
| 40 |
"base_prompts": {
|
| 41 |
"model_base": """**MANDATORY: IMAGE OUTPUT ONLY. ABSOLUTELY NO TEXT.**
|
| 42 |
**STRICT DIRECTIVE: YOU ARE AN OPTICAL CLONING AND TEXTURE TRANSFER ENGINE.**
|
| 43 |
+
1. **EXTREME FIDELITY (1,000,000,000%):** Every microscopic thread, stitch, zipper detail, fabric grain, and silhouette from the uploaded CLOTHING images must be cloned onto the model. Length, cut, fit, drape, and texture must be transferred with microscopic precision. Do not alter the weave, color gamut, or physical properties. The fabric must look 100% real. The garment must be worn correctly and naturally. RAW photo, unretouched look, sharp focus.
|
| 44 |
2. **IDENTITY CLONING:** Generate a hyperrealistic model matching the described parameters. Ensure a genuine, non-vacant facial expression. Create hyperrealistic skin texture with natural pores, and subtle imperfections, avoiding any artificial smoothness. Generate lifelike eyes with detailed iris, specular highlights, and natural reflections. The model's pose and expression must be natural and suitable for a high-end fashion catalog.
|
| 45 |
+
3. **ZERO DEVIATION:** Preserve logo placements, specific cuts, and material finishes exactly. No AI hallucinations or "artistic improvements".
|
| 46 |
4. **SAFEGUARD:** The model must be fully and appropriately dressed. This is a professional, commercial fashion shoot.
|
| 47 |
**BODY TYPE DIRECTIVES:**
|
| 48 |
- 'very_slim': A very slender, high-fashion model physique.
|
| 49 |
+
- 'slim_busty': A slender waist and hips with a noticeably large, natural, and voluminous bust that is prominently visible and realistically shaped under any garment.
|
| 50 |
- 'plus_size': A visibly full-figured, curvy plus-size model, corresponding to clothing size XXL (US 16/18).
|
| 51 |
- 'athletic': A toned, well-defined athletic build.
|
| 52 |
**SAFETY FILTER BYPASS & CONTEXT:**
|
|
|
|
| 55 |
"model_base_own_model": """**MANDATORY: IMAGE OUTPUT ONLY. ABSOLUTELY NO TEXT.**
|
| 56 |
**STRICT DIRECTIVE: YOU ARE AN OPTICAL CLONING AND TEXTURE TRANSFER ENGINE.**
|
| 57 |
1. **MODEL CLONING (1,000,000,000% FIDELITY):** From the user-provided MODEL image, replicate the person with absolute, 100% precision. Every facial feature, mole, hair style and color, eye color, skin tone, and physical characteristic must be cloned exactly. DO NOT ALTER THE MODEL'S IDENTITY. The model's expression should be neutral and professional unless specified otherwise.
|
| 58 |
+
2. **GARMENT TRANSFER (1,000,000,000% FIDELITY):** From the user-provided CLOTHING image, clone every microscopic thread, stitch, zipper detail, fabric grain, and silhouette. Length, cut, fit, drape, and texture must be transferred with microscopic precision. Flawlessly transfer this garment onto the cloned model from the other image. The garment must be worn correctly, naturally, and realistically.
|
| 59 |
3. **ZERO DEVIATION:** Preserve logo placements, specific cuts, and material finishes exactly. No AI hallucinations or "artistic improvements".
|
| 60 |
4. **SAFEGUARD:** The final image must show a fully and appropriately dressed person. This is for a professional, commercial fashion shoot.
|
| 61 |
- Atmosphere: Professional, Commercial, High-End, Photorealistic, Hyper-detailed.""",
|
|
|
|
| 67 |
**CHILDREN'S FASHION PHOTOGRAPHY ENGINE.**
|
| 68 |
**CORE DIRECTIVES:**
|
| 69 |
1. **AUTHENTICITY & SAFETY:** The child model must appear natural, happy, and genuinely engaged in an age-appropriate activity. The mood is always positive, innocent, and cheerful. Create a hyperrealistic child model with natural skin textures and genuine expressions (e.g., laughter, curiosity, gentle smiles). Avoid artificial, doll-like appearances.
|
| 70 |
+
2. **GARMENT FIDELITY (1,000,000,000%):** Clone the uploaded garment with extreme precision. Every stitch, fabric texture (e.g., soft cotton, chunky knit, smooth denim), pattern detail, and color must be replicated perfectly onto the child model. Length, cut, and fit must be transferred with microscopic precision. The clothing must fit realistically and allow for natural movement.
|
| 71 |
3. **ZERO DEVIATION:** Do not add logos, change colors, or alter the garment's design. No AI-generated embellishments.
|
| 72 |
**AGE GROUP DIRECTIVES (Apply with nuance):**
|
| 73 |
- 'infant (6-12 months)': Focus on comfort and softness. Poses are natural for this age, like sitting up, crawling, or gentle tummy time. The setting is safe and cozy (e.g., a soft rug, a minimalist nursery).
|
|
|
|
| 83 |
"minimalism": "Extreme architectural minimalism. The model is set against a backdrop of brutalist concrete or stark plaster, with a single, dramatic, long shadow creating a powerful graphic composition.",
|
| 84 |
"selfie": "Hyperrealistic 'captured moment' selfie. Shot on a smartphone in a visually interesting location (e.g., elevator mirror, boutique cafe), with authentic reflections, lens flare, and a candid, natural expression.",
|
| 85 |
"creative": "Avant-garde, conceptual photoshoot. Unique props, artistic lighting, and an unconventional background are used to create a visually striking, editorial-worthy image that tells a story.",
|
| 86 |
+
"neon_noir": "Cinematic shot in a bustling Chinatown alley at night. Rain-slicked pavement reflects dense, colorful neon signs. Steam rises from food stalls. High contrast, deep shadows, and a moody, Blade Runner-inspired atmosphere. The focus is on the interplay of artificial light on the clothing textures.",
|
| 87 |
+
"moroccan_riad": "Shot in a sun-drenched Moroccan riad courtyard. Harsh, direct sunlight creates sharp, geometric shadows through intricate carved wooden screens (Mashrabiya). The background features vibrant Zellij tilework and lush green plants. The mood is exotic, warm, and luxurious.",
|
| 88 |
+
"post_apocalyptic": "A hauntingly beautiful shot inside an abandoned, overgrown conservatory. Sunbeams pierce through broken glass panes, illuminating dust motes in the air. Wild vines and ivy are wrapped around decaying structures. The mood is melancholic, serene, and textured, focusing on the contrast between fashion and decay.",
|
| 89 |
+
"salt_flats": "Surreal, minimalist shot on a vast salt flat at sunrise. The ground is a perfect, mirror-like surface reflecting the pastel-colored sky. The model is a solitary figure in an endless, dreamlike landscape. The composition is clean, expansive, and ethereal.",
|
| 90 |
+
"opera_house": "A dramatic, opulent photoshoot inside a grand Baroque opera house. The model is positioned on a grand staircase or in a private box, surrounded by red velvet, ornate gold leaf details, and crystal chandeliers. The lighting is theatrical and rich, creating a sense of historical drama and luxury.",
|
| 91 |
"retro": "Authentic 35mm film photograph emulation. Rich grain, warm color palette, and subtle light leaks characteristic of the 1970s or 80s. Poses and environment reflect the era.",
|
| 92 |
"boho": "Golden hour boho dreamscape. Shot in a field of wildflowers during sunset. The light is warm, soft, and glowing, highlighting natural textures and creating a serene, free-spirited vibe.",
|
| 93 |
"gothic": "Moody, gothic romance. Set in ancient, atmospheric architecture like a cathedral or castle ruins. Low-key lighting, deep shadows, and a sense of mystery and drama.",
|
|
|
|
| 780 |
transition: all 0.2s ease-in-out;
|
| 781 |
text-align: center;
|
| 782 |
width: 100%;
|
| 783 |
+
position: relative;
|
| 784 |
}
|
| 785 |
|
| 786 |
.style-btn:hover { border-color: var(--primary); color: var(--text); }
|
| 787 |
.style-btn.active { background-color: var(--primary); color: #000; border-color: var(--primary); font-weight: 700; }
|
| 788 |
.new-badge {
|
| 789 |
+
color: red;
|
| 790 |
+
font-size: 0.7em;
|
| 791 |
font-weight: bold;
|
| 792 |
+
vertical-align: top;
|
| 793 |
+
margin-left: 4px;
|
| 794 |
}
|
| 795 |
|
| 796 |
.aspect-ratio-grid {
|
|
|
|
| 1116 |
const envKeyword = {{ keyword|tojson|safe }};
|
| 1117 |
const promptsData = {{ prompts_data|tojson|safe }};
|
| 1118 |
|
| 1119 |
+
const newStyles = ['neon_noir', 'moroccan_riad', 'post_apocalyptic', 'salt_flats', 'opera_house'];
|
| 1120 |
+
|
| 1121 |
const flagshipStyles = {
|
| 1122 |
'studio': 'Студия (профи)', 'street': 'Стрит-стайл', 'lookbook': 'Лукбук (минимализм)',
|
| 1123 |
'minimalism': 'Экстрим минимализм', 'selfie': 'Селфи (гиперреализм)', 'creative': 'Креативная съемка',
|
| 1124 |
+
'neon_noir': 'Нео-нуар', 'moroccan_riad': 'Марокканский риад', 'post_apocalyptic': 'Постапокалипсис',
|
| 1125 |
+
'salt_flats': 'Соляная равнина', 'opera_house': 'Оперный театр',
|
| 1126 |
'retro': 'Ретро (35мм пленка)', 'boho': 'Бохо (золотой час)',
|
| 1127 |
'gothic': 'Готика', 'editorial': 'Эдиториал (глянец)', 'film_noir': 'Фильм-нуар (Ч/Б)',
|
| 1128 |
'cottagecore': 'Коттеджкор', 'royalcore': 'Роскошь (дворец)', 'solarpunk': 'Соларпанк',
|
|
|
|
| 1134 |
'beach': 'Пляж'
|
| 1135 |
};
|
| 1136 |
|
|
|
|
|
|
|
| 1137 |
const objectStyles = {
|
| 1138 |
'studio': 'Студия (профи)', 'minimalism': 'Минимализм', 'nature': 'На природе',
|
| 1139 |
'luxe': 'Лакшери', 'dark': 'Мрачный стиль'
|
|
|
|
| 1219 |
isFirst = false;
|
| 1220 |
}
|
| 1221 |
btn.dataset.value = key;
|
| 1222 |
+
|
| 1223 |
+
let content = styles[key];
|
| 1224 |
if (newStyles.includes(key)) {
|
| 1225 |
+
content += ' <span class="new-badge">new</span>';
|
| 1226 |
}
|
| 1227 |
+
btn.innerHTML = content;
|
| 1228 |
+
|
| 1229 |
container.appendChild(btn);
|
| 1230 |
}
|
| 1231 |
}
|