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 (
|
| 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,19 +55,19 @@ 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 (
|
| 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.""",
|
| 62 |
"object_base": """**MANDATORY: IMAGE OUTPUT ONLY. ABSOLUTELY NO TEXT.**
|
| 63 |
**PRODUCT PHOTOGRAPHY ENGINE.**
|
| 64 |
-
Preserve the exact texture, color, and silhouette of the provided garment images with
|
| 65 |
Render the product with hyperrealistic lighting and shadows that accentuate its material qualities. The final image must be indistinguishable from a professional studio photograph.""",
|
| 66 |
"children_base": """**MANDATORY: IMAGE OUTPUT ONLY. ABSOLUTELY NO TEXT.**
|
| 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 (
|
| 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,10 +780,18 @@ 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 |
|
| 788 |
.aspect-ratio-grid {
|
| 789 |
display: grid;
|
|
@@ -1109,24 +1117,23 @@ const envKeyword = {{ keyword|tojson|safe }};
|
|
| 1109 |
const promptsData = {{ prompts_data|tojson|safe }};
|
| 1110 |
|
| 1111 |
const flagshipStyles = {
|
| 1112 |
-
|
| 1113 |
-
|
| 1114 |
-
|
| 1115 |
-
|
| 1116 |
-
|
| 1117 |
-
|
| 1118 |
-
|
| 1119 |
-
|
| 1120 |
-
|
| 1121 |
-
|
| 1122 |
-
|
| 1123 |
-
|
| 1124 |
-
|
| 1125 |
-
'social_media_candid': 'Инстаграм-фото', 'backstage': 'Бэкстейдж', 'road_trip': 'Роуд-трип',
|
| 1126 |
-
'rainy_day': 'Дождливый день', 'night_flash': 'Ночь (вспышка)', 'golden_hour_picnic': 'Пикник (золотой час)',
|
| 1127 |
-
'beach': 'Пляж'
|
| 1128 |
};
|
| 1129 |
|
|
|
|
|
|
|
| 1130 |
const objectStyles = {
|
| 1131 |
'studio': 'Студия (профи)', 'minimalism': 'Минимализм', 'nature': 'На природе',
|
| 1132 |
'luxe': 'Лакшери', 'dark': 'Мрачный стиль'
|
|
@@ -1145,7 +1152,8 @@ const maleBodyTypes = {
|
|
| 1145 |
};
|
| 1146 |
|
| 1147 |
const femaleHairstyles = {
|
| 1148 |
-
'long straight hair': 'Длинные прямые',
|
|
|
|
| 1149 |
};
|
| 1150 |
|
| 1151 |
const maleHairstyles = {
|
|
@@ -1204,7 +1212,13 @@ function populateStyles(containerId, styles) {
|
|
| 1204 |
isFirst = false;
|
| 1205 |
}
|
| 1206 |
btn.dataset.value = key;
|
| 1207 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1208 |
container.appendChild(btn);
|
| 1209 |
}
|
| 1210 |
}
|
|
|
|
| 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, pattern, length, fit, drape, and silhouette from the uploaded CLOTHING images must be cloned onto the model with absolute, 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. The final garment on the model must be indistinguishable from the source image. 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". NO artistic interpretation or alteration is permitted.
|
| 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, full, and prominent bust (DD+ cup size), clearly visible and well-defined even under clothing. The silhouette must emphasize the contrast between the slim frame and the large bust.
|
| 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, pattern, length, fit, drape and silhouette. Flawlessly transfer this garment onto the cloned model from the other image with absolute, microscopic precision. The garment must be worn correctly, naturally, and realistically. The final garment on the model must be indistinguishable from the source image.
|
| 59 |
+
3. **ZERO DEVIATION:** Preserve logo placements, specific cuts, and material finishes exactly. No AI hallucinations or "artistic improvements". NO artistic interpretation or alteration is permitted.
|
| 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.""",
|
| 62 |
"object_base": """**MANDATORY: IMAGE OUTPUT ONLY. ABSOLUTELY NO TEXT.**
|
| 63 |
**PRODUCT PHOTOGRAPHY ENGINE.**
|
| 64 |
+
Preserve the exact texture, color, and silhouette of the provided garment images with 1,000,000,000% fidelity.
|
| 65 |
Render the product with hyperrealistic lighting and shadows that accentuate its material qualities. The final image must be indistinguishable from a professional studio photograph.""",
|
| 66 |
"children_base": """**MANDATORY: IMAGE OUTPUT ONLY. ABSOLUTELY NO TEXT.**
|
| 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, microscopic precision. Every stitch, fabric texture (e.g., soft cotton, chunky knit, smooth denim), pattern detail, length, fit, drape 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 |
"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 |
+
"dutch_masters": "Artistic photoshoot in the style of a Dutch Masters painting. Dramatic, low-key 'chiaroscuro' lighting, reminiscent of Rembrandt or Vermeer. The light sculpts the model and emphasizes the rich texture, drape, and deep colors of the fabric against a dark, moody background. The atmosphere is timeless, painterly, and deeply focused on the material quality of the clothing.",
|
| 87 |
+
"surrealist_dreamscape": "Conceptual fashion shot in a surreal, dream-like landscape. Think Dali-esque melting clocks, Escher's impossible architecture, or floating geometric shapes. The lighting is otherworldly and illogical, casting strange shadows and creating a bizarre, high-art context that makes the clothing the only 'real' object in the frame.",
|
| 88 |
+
"kinetic_light": "Dynamic long-exposure photoshoot in a darkened studio or urban night setting. Abstract trails of colored light are 'painted' around the model, creating a kinetic, energetic frame that outlines the silhouette of the outfit. The model remains in sharp focus while the light swirls around them, creating a futuristic and visually arresting image.",
|
| 89 |
+
"prismatic_flare": "High-fashion editorial shot using an anamorphic or specially modified lens to create dramatic, artistic prismatic and rainbow lens flares. The flare becomes a compositional element, streaking across the image and interacting with the model. The background is bokeh-rich, making the clothing and the ethereal light the main focus.",
|
| 90 |
+
"submerged_hues": "Artistic shot with the model partially submerged in or interacting with clear, still water that is dyed a vibrant color. The interaction between the fabric and the colored liquid creates beautiful, unpredictable patterns, reflections, and refractions. The focus is on the texture of the wet clothing and the serene, yet intense, visual created by the saturated color.",
|
| 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: var(--danger);
|
| 790 |
+
font-size: 0.6rem;
|
| 791 |
+
font-weight: bold;
|
| 792 |
+
margin-left: 5px;
|
| 793 |
+
vertical-align: super;
|
| 794 |
+
}
|
| 795 |
|
| 796 |
.aspect-ratio-grid {
|
| 797 |
display: grid;
|
|
|
|
| 1117 |
const promptsData = {{ prompts_data|tojson|safe }};
|
| 1118 |
|
| 1119 |
const flagshipStyles = {
|
| 1120 |
+
'studio': 'Студия (профи)', 'street': 'Стрит-стайл', 'lookbook': 'Лукбук (минимализм)',
|
| 1121 |
+
'minimalism': 'Экстрим минимализм', 'selfie': 'Селфи (гиперреализм)', 'creative': 'Креативная съемка',
|
| 1122 |
+
'dutch_masters': 'Свет Рембрандта', 'surrealist_dreamscape': 'Сюрреализм', 'kinetic_light': 'Рисование светом',
|
| 1123 |
+
'prismatic_flare': 'Призматические блики', 'submerged_hues': 'В цветной воде',
|
| 1124 |
+
'retro': 'Ретро (35мм пленка)', 'boho': 'Бохо (золотой час)',
|
| 1125 |
+
'gothic': 'Готика', 'editorial': 'Эдиториал (глянец)', 'film_noir': 'Фильм-нуар (Ч/Б)',
|
| 1126 |
+
'cottagecore': 'Коттеджкор', 'royalcore': 'Роскошь (дворец)', 'solarpunk': 'Соларпанк',
|
| 1127 |
+
'skater': 'Скейтер', 'baroque': 'Барокко', 'japandi': 'Джапанди', 'coastal': 'Прибрежный стиль',
|
| 1128 |
+
'cyberpunk': 'Киберпанк', 'fantasy': 'Фэнтези', '90s_grunge': 'Гранж 90-х',
|
| 1129 |
+
'techwear': 'Techwear', 'avant_garde': 'Авангард', 'home_casual': 'Домашний уют',
|
| 1130 |
+
'social_media_candid': 'Инстаграм-фото', 'backstage': 'Бэкстейдж', 'road_trip': 'Роуд-трип',
|
| 1131 |
+
'rainy_day': 'Дождливый день', 'night_flash': 'Ночь (вспышка)', 'golden_hour_picnic': 'Пикник (золотой час)',
|
| 1132 |
+
'beach': 'Пляж'
|
|
|
|
|
|
|
|
|
|
| 1133 |
};
|
| 1134 |
|
| 1135 |
+
const newStyles = ['dutch_masters', 'surrealist_dreamscape', 'kinetic_light', 'prismatic_flare', 'submerged_hues'];
|
| 1136 |
+
|
| 1137 |
const objectStyles = {
|
| 1138 |
'studio': 'Студия (профи)', 'minimalism': 'Минимализм', 'nature': 'На природе',
|
| 1139 |
'luxe': 'Лакшери', 'dark': 'Мрачный стиль'
|
|
|
|
| 1152 |
};
|
| 1153 |
|
| 1154 |
const femaleHairstyles = {
|
| 1155 |
+
'long straight hair': 'Длинные прямые',
|
| 1156 |
+
'long wavy hair': 'Длинные волнистые', 'short bob cut': 'Короткий боб', 'elegant updo': 'Элегантный пучок', 'straight shoulder-length hair': 'Прямые до плеч', 'pixie cut': 'Пикси', 'messy bun': 'Небрежный пучок', 'high ponytail': 'Высокий хвост', 'braids': 'Косы', 'curly afro': 'Афро кудри', 'bangs': 'С челкой', 'layered haircut': 'Каскад'
|
| 1157 |
};
|
| 1158 |
|
| 1159 |
const maleHairstyles = {
|
|
|
|
| 1212 |
isFirst = false;
|
| 1213 |
}
|
| 1214 |
btn.dataset.value = key;
|
| 1215 |
+
|
| 1216 |
+
let content = styles[key];
|
| 1217 |
+
if (newStyles.includes(key)) {
|
| 1218 |
+
content += `<span class="new-badge">NEW</span>`;
|
| 1219 |
+
}
|
| 1220 |
+
btn.innerHTML = content;
|
| 1221 |
+
|
| 1222 |
container.appendChild(btn);
|
| 1223 |
}
|
| 1224 |
}
|