Kgshop commited on
Commit
f1bc149
·
verified ·
1 Parent(s): 8dc911d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -28
app.py CHANGED
@@ -781,6 +781,9 @@ select option {
781
  <option value="20-25 years old" selected>20-25 лет</option>
782
  <option value="25-30 years old">25-30 лет</option>
783
  <option value="30-40 years old">30-40 лет</option>
 
 
 
784
  </select>
785
  </div>
786
  <div class="form-group">
@@ -882,17 +885,17 @@ select option {
882
  <label>Локация</label>
883
  <div id="locationSelector" class="style-grid">
884
  <button type="button" class="style-btn active" data-value="in a clean white seamless studio background">Студия (белый фон)</button>
885
- <button type="button" class="style-btn" data-value="in a creative editorial studio with mirrors and geometric shapes">Студия "Эдиториал"</button>
886
  <button type="button" class="style-btn" data-value="on a rainy night street in Tokyo with neon lights">Ночной Токио (неон)</button>
887
  <button type="button" class="style-btn" data-value="in a minimalist modern interior with concrete walls">Лофт (бетон)</button>
888
  <button type="button" class="style-btn" data-value="on a rooftop overlooking the city skyline at sunset">Крыша (закат)</button>
889
  <button type="button" class="style-btn" data-value="in a luxurious vintage room with classic furniture">Роскошный интерьер</button>
 
890
  <button type="button" class="style-btn" data-value="in a dense, magical forest with sunbeams filtering through">Сказочный лес</button>
891
  <button type="button" class="style-btn" data-value="on a beautiful sandy beach during the golden hour">Пляж (золотой час)</button>
892
  <button type="button" class="style-btn" data-value="in a vibrant, bustling urban market">Городской рынок</button>
893
  <button type="button" class="style-btn" data-value="inside a futuristic, sci-fi corridor with glowing lines">НФ коридор</button>
894
  <button type="button" class="style-btn" data-value="in an old, atmospheric library with tall bookshelves">Старая библиотека</button>
895
- <button type="button" class="style-btn" data-value="at a vibrant, colorful carnival at night">Ночной карнавал</button>
896
  </div>
897
  </div>
898
  <div class="form-group full-width">
@@ -1032,15 +1035,21 @@ select option {
1032
  </select>
1033
  </div>
1034
  <div class="form-group full-width">
1035
- <label for="child_location">Локация</label>
1036
- <select id="child_location">
1037
- <option value="in a clean white seamless studio background">Студия (белый фон)</option>
1038
- <option value="in a sunlit green park">Солнечный парк</option>
1039
- <option value="on a sandy beach">Песчаный пляж</option>
1040
- <option value="in a cozy, decorated children's room">Уютная детская комната</option>
1041
- <option value="in a magical forest">Сказочный лес</option>
1042
- <option value="at an urban playground">Городская площадка</option>
1043
- </select>
 
 
 
 
 
 
1044
  </div>
1045
  <div class="form-group full-width">
1046
  <label for="child_style">Эстетика</label>
@@ -1215,7 +1224,7 @@ function toggleCreativeMode() {
1215
  }
1216
 
1217
  function setupClickableSelectors() {
1218
- const selectors = ['styleSelector', 'locationSelector'];
1219
  selectors.forEach(selectorId => {
1220
  const container = document.getElementById(selectorId);
1221
  if (!container) return;
@@ -1256,30 +1265,31 @@ async function processAndOpen() {
1256
 
1257
  if (generateDetailsCollage) {
1258
  fullPrompt = `${envKeyword}, style:: A professional fashion lookbook page, ${style}, hyper-realistic photography, clean and minimalist layout with a lot of negative space.
1259
- composition:: The final image is a collage. The main image occupies the top 70% of the canvas. Below the main image are three smaller, perfectly square detail shots arranged in a neat horizontal row. A clean white background separates all images.
1260
- main_image_description:: A ${shotType} of a striking ${age} ${nationality} ${gender} high fashion model. Model characteristics: physique ${bodyType}, ${hairColor} ${hairstyle}, expression ${emotion}, pose ${pose}. The model is wearing ${details}. The environment is ${location}. The lighting is ${light}.
1261
- detail_shot_1_description:: A hyper-detailed macro photograph focusing on the raw texture of the fabric from the clothing.
1262
- detail_shot_2_description:: An extreme close-up of a key hardware detail, such as an intricate button, a metallic zipper, or a unique buckle.
1263
- detail_shot_3_description:: A close-up shot showcasing the quality of the craftsmanship, focusing on the stitching and seams of the garment.
 
1264
  technical:: Each individual image in this collage is an 8k UHD masterpiece, shot on ${camera}, with perfect ${light}, and razor-sharp focus. The entire composition must look like a real, high-end page from a luxury brand's official website or catalog.`;
1265
 
1266
  } else if (isMyModel) {
1267
  const myModelDetails = document.getElementById('model_details').value || "the clothing from the reference image";
1268
  fullPrompt = `${envKeyword}, VIRTUAL TRY-ON.
1269
  INSTRUCTIONS: This is a virtual try-on task. Use the model's photo for identity, face, and pose. Use the garment photo for the clothing.
1270
- Task: Accurately transfer the clothing onto the model. The final image must preserve the model's exact facial identity, body shape of "${bodyType}", and pose.
1271
  Style: ${style}, hyper-detailed, luxury brand campaign, Vogue aesthetic, ultra-photorealistic.
1272
- Composition: ${shotType}.
1273
  Final Scene: Place the model in the following environment: ${location}.
1274
  Lighting: The scene must have ${light}.
1275
  Technical: Masterpiece professional photograph, shot on ${camera}, 8k UHD, razor-sharp focus, extreme detail, perfect color grading, no digital artifacts.`;
1276
  } else {
1277
  fullPrompt = `${envKeyword}, style:: ${style}, high fashion editorial, luxury brand campaign (like Dior, D&G), Vogue aesthetic, hyper-realistic photography, award-winning.
1278
- composition:: ${shotType}.
1279
  subject:: An ultra-high-resolution, flawless photograph of a striking ${age} ${nationality} ${gender} high fashion model.
1280
  model_characteristics:: physique ${bodyType}, ${hairColor} ${hairstyle} with individual strands visible and natural flyaways, expression ${emotion} (powerful yet serene), pose ${pose}.
1281
- clothing_focus:: The model is wearing ${details}, emphasizing haute couture craftsmanship.
1282
- texture_&_material_fidelity:: Extreme macro precision on textiles. Render the fabric weave, individual threads, visible stitching, material weight, realistic creases and folds, tactile surface imperfections like denim twill or wool fibers, and how light interacts with the fabric.
1283
  human_realism_details:: Capture hyper-realistic skin texture, showing pores, vellus hair, and subtle imperfections. Avoid any plastic or airbrushed look. Expertly sculpted light highlights the bone structure. Eyes must have realistic reflections and depth.
1284
  scene_environment:: ${location}, creating a sophisticated and aspirational atmosphere.
1285
  technical:: Masterpiece professional photograph, ${light} meticulously crafted to sculpt the subject with soft shadows and catchlights in eyes, shot on ${camera}, 8k UHD, razor-sharp focus, breathtaking detail, uncompressed, color graded to perfection.`;
@@ -1288,7 +1298,7 @@ technical:: Masterpiece professional photograph, ${light} meticulously crafted t
1288
  } else if (currentMode === 'children') {
1289
  const style = document.getElementById('child_style').value;
1290
  const shotType = document.getElementById('child_shotType').value;
1291
- const location = document.getElementById('child_location').value;
1292
  const light = document.getElementById('child_light').value;
1293
  let subject = '';
1294
  let pose_info = '';
@@ -1314,11 +1324,11 @@ technical:: Masterpiece professional photograph, ${light} meticulously crafted t
1314
  }
1315
 
1316
  fullPrompt = `${envKeyword}, style:: ${style}, luxury children's fashion campaign, cinematic storytelling, enchanting, ultra-photorealistic.
1317
- composition:: ${shotType}.
1318
  subject:: ${subject} The photograph must look like a cover shot for a high-end children's fashion magazine.
1319
- clothing_focus:: The child is wearing ${clothing_details}, presented as a luxury garment.
1320
- texture_&_material_fidelity:: Macro-level detail on clothing textures. Focus on the weave of cotton, the softness of wool fibers, the texture of denim. Show realistic wrinkles, creases from movement, and even subtle fabric pilling. Absolute texture fidelity is crucial.
1321
- human_realism_details:: Capture the pure, innocent beauty of the child. Hyper-realistic, dewy skin with a natural glow and visible texture, not airbrushed. The light should have a painterly, almost magical quality, highlighting their features beautifully. Eyes must be expressive, with realistic reflections and depth. Individual hair strands should be visible.
1322
  scene_activity:: ${pose_info} The location is ${location}, creating a whimsical and high-end narrative.
1323
  technical:: Masterpiece photograph, ${light} creating a magical and soft atmosphere, shot on Fujifilm XT4, 56mm F1.2 lens, 8k, tack sharp focus, impeccable detail, perfect color grading, looks like a real captured moment of wonder from a luxury campaign.`;
1324
 
@@ -1340,7 +1350,7 @@ technical:: Masterpiece photograph, ${light} creating a magical and soft atmosph
1340
  fullPrompt = `${envKeyword}, style:: Luxury product advertising, ${objectStyle}, sophisticated, sleek, ultra-photorealistic.
1341
  subject:: A breathtaking, hyper-realistic photograph of the luxury product: ${objectName}. The image must evoke desire and exclusivity, looking like a real, professionally shot advertisement.
1342
  material_focus:: Achieve 1000% physical accuracy with an emphasis on perfection. Render pristine, flawless surfaces with micro-scratches and realistic imperfections. Showcase the intricate details of the material grain, polished metal sheen with fingerprints, or crystal-clear refractions. Even microscopic dust particles should look clean and perfect.
1343
- scene_context:: Placed ${background}. Additional details: ${objectDetails}, arranged with artistic precision.
1344
  composition:: ${objectComposition}, creating a powerful and elegant visual statement.
1345
  technical:: Advertisement-grade photograph, ${objectLighting} designed to accentuate the product's luxury form and textures, 8k UHD resolution, flawless focus, extreme macro detail, advanced ray-traced reflections and caustics, impeccably clean, exudes quality and high-end appeal, masterpiece.`;
1346
  }
 
781
  <option value="20-25 years old" selected>20-25 лет</option>
782
  <option value="25-30 years old">25-30 лет</option>
783
  <option value="30-40 years old">30-40 лет</option>
784
+ <option value="40-50 years old">40-50 лет</option>
785
+ <option value="50-60 years old">50-60 лет</option>
786
+ <option value="60+ years old">60+ лет</option>
787
  </select>
788
  </div>
789
  <div class="form-group">
 
885
  <label>Локация</label>
886
  <div id="locationSelector" class="style-grid">
887
  <button type="button" class="style-btn active" data-value="in a clean white seamless studio background">Студия (белый фон)</button>
888
+ <button type="button" class="style-btn" data-value="in a creative editorial studio with colorful lights, mirrors and geometric shapes">Студия "Эдиториал"</button>
889
  <button type="button" class="style-btn" data-value="on a rainy night street in Tokyo with neon lights">Ночной Токио (неон)</button>
890
  <button type="button" class="style-btn" data-value="in a minimalist modern interior with concrete walls">Лофт (бетон)</button>
891
  <button type="button" class="style-btn" data-value="on a rooftop overlooking the city skyline at sunset">Крыша (закат)</button>
892
  <button type="button" class="style-btn" data-value="in a luxurious vintage room with classic furniture">Роскошный интерьер</button>
893
+ <button type="button" class="style-btn" data-value="in a luxurious baroque grand hall with ornate gold details, crystal chandeliers, and velvet drapes">Барокко</button>
894
  <button type="button" class="style-btn" data-value="in a dense, magical forest with sunbeams filtering through">Сказочный лес</button>
895
  <button type="button" class="style-btn" data-value="on a beautiful sandy beach during the golden hour">Пляж (золотой час)</button>
896
  <button type="button" class="style-btn" data-value="in a vibrant, bustling urban market">Городской рынок</button>
897
  <button type="button" class="style-btn" data-value="inside a futuristic, sci-fi corridor with glowing lines">НФ коридор</button>
898
  <button type="button" class="style-btn" data-value="in an old, atmospheric library with tall bookshelves">Старая библиотека</button>
 
899
  </div>
900
  </div>
901
  <div class="form-group full-width">
 
1035
  </select>
1036
  </div>
1037
  <div class="form-group full-width">
1038
+ <label>Локация</label>
1039
+ <div id="childLocationSelector" class="style-grid">
1040
+ <button type="button" class="style-btn active" data-value="in a clean white seamless studio background">Студия (белый фон)</button>
1041
+ <button type="button" class="style-btn" data-value="in a creative editorial studio with colorful lights, mirrors and geometric shapes">Студия "Эдиториал"</button>
1042
+ <button type="button" class="style-btn" data-value="on a rainy night street in Tokyo with neon lights">Ночной Токио (неон)</button>
1043
+ <button type="button" class="style-btn" data-value="in a minimalist modern interior with concrete walls">Лофт етон)</button>
1044
+ <button type="button" class="style-btn" data-value="on a rooftop overlooking the city skyline at sunset">Крыша (закат)</button>
1045
+ <button type="button" class="style-btn" data-value="in a luxurious vintage room with classic furniture">Роскошный интерьер</button>
1046
+ <button type="button" class="style-btn" data-value="in a luxurious baroque grand hall with ornate gold details, crystal chandeliers, and velvet drapes">Барокко</button>
1047
+ <button type="button" class="style-btn" data-value="in a dense, magical forest with sunbeams filtering through">Сказочный лес</button>
1048
+ <button type="button" class="style-btn" data-value="on a beautiful sandy beach during the golden hour">Пляж (золотой час)</button>
1049
+ <button type="button" class="style-btn" data-value="in a vibrant, bustling urban market">Городской рынок</button>
1050
+ <button type="button" class="style-btn" data-value="inside a futuristic, sci-fi corridor with glowing lines">НФ коридор</button>
1051
+ <button type="button" class="style-btn" data-value="in an old, atmospheric library with tall bookshelves">Старая библиотека</button>
1052
+ </div>
1053
  </div>
1054
  <div class="form-group full-width">
1055
  <label for="child_style">Эстетика</label>
 
1224
  }
1225
 
1226
  function setupClickableSelectors() {
1227
+ const selectors = ['styleSelector', 'locationSelector', 'childLocationSelector'];
1228
  selectors.forEach(selectorId => {
1229
  const container = document.getElementById(selectorId);
1230
  if (!container) return;
 
1265
 
1266
  if (generateDetailsCollage) {
1267
  fullPrompt = `${envKeyword}, style:: A professional fashion lookbook page, ${style}, hyper-realistic photography, clean and minimalist layout with a lot of negative space.
1268
+ composition:: The final image is a collage. The main image occupies the top 70% of the canvas, it must be a ${shotType}. Below the main image are three smaller, perfectly square detail shots arranged in a neat horizontal row. A clean white background separates all images.
1269
+ main_image_description:: A ${shotType} of a striking ${age} ${nationality} ${gender} high fashion model. Model characteristics: physique ${bodyType}, ${hairColor} ${hairstyle}, expression ${emotion}, pose ${pose}. The model is wearing EXACTLY the following: ${details}. This description must be followed with 1000% fidelity.
1270
+ detail_shot_1_description:: A hyper-detailed macro photograph focusing on the raw texture of the fabric from the clothing described above.
1271
+ detail_shot_2_description:: An extreme close-up of a key hardware detail from the clothing, such as an intricate button, a metallic zipper, or a unique buckle.
1272
+ detail_shot_3_description:: A close-up shot showcasing the quality of the craftsmanship, focusing on the stitching and seams of the garment described above.
1273
+ environment_and_lighting:: The main image environment is ${location}. The lighting is ${light}.
1274
  technical:: Each individual image in this collage is an 8k UHD masterpiece, shot on ${camera}, with perfect ${light}, and razor-sharp focus. The entire composition must look like a real, high-end page from a luxury brand's official website or catalog.`;
1275
 
1276
  } else if (isMyModel) {
1277
  const myModelDetails = document.getElementById('model_details').value || "the clothing from the reference image";
1278
  fullPrompt = `${envKeyword}, VIRTUAL TRY-ON.
1279
  INSTRUCTIONS: This is a virtual try-on task. Use the model's photo for identity, face, and pose. Use the garment photo for the clothing.
1280
+ Task: Accurately transfer the clothing onto the model. The final image must preserve the model's exact facial identity, body shape of "${bodyType}", and pose. The clothing details must be rendered with 1000% fidelity based on this description: ${myModelDetails}.
1281
  Style: ${style}, hyper-detailed, luxury brand campaign, Vogue aesthetic, ultra-photorealistic.
1282
+ Composition: ${shotType}, ensure the entire body from head to toe is visible if the plan is full body.
1283
  Final Scene: Place the model in the following environment: ${location}.
1284
  Lighting: The scene must have ${light}.
1285
  Technical: Masterpiece professional photograph, shot on ${camera}, 8k UHD, razor-sharp focus, extreme detail, perfect color grading, no digital artifacts.`;
1286
  } else {
1287
  fullPrompt = `${envKeyword}, style:: ${style}, high fashion editorial, luxury brand campaign (like Dior, D&G), Vogue aesthetic, hyper-realistic photography, award-winning.
1288
+ composition:: ${shotType}. If the shot type is 'Full body shot', the image must clearly show the model from head to toe without any part of the body being cropped.
1289
  subject:: An ultra-high-resolution, flawless photograph of a striking ${age} ${nationality} ${gender} high fashion model.
1290
  model_characteristics:: physique ${bodyType}, ${hairColor} ${hairstyle} with individual strands visible and natural flyaways, expression ${emotion} (powerful yet serene), pose ${pose}.
1291
+ clothing_focus:: HIGHEST PRIORITY - The model is wearing EXACTLY: ${details}. This description is absolute and must be followed with 1000% accuracy, overriding any other assumptions. Physical accuracy of the described items is critical.
1292
+ texture_&_material_fidelity:: Extreme macro precision on textiles. Render the fabric weave, individual threads, visible stitching, material weight, realistic creases and folds, tactile surface imperfections like denim twill or wool fibers, and how light interacts with the fabric as described in the clothing focus.
1293
  human_realism_details:: Capture hyper-realistic skin texture, showing pores, vellus hair, and subtle imperfections. Avoid any plastic or airbrushed look. Expertly sculpted light highlights the bone structure. Eyes must have realistic reflections and depth.
1294
  scene_environment:: ${location}, creating a sophisticated and aspirational atmosphere.
1295
  technical:: Masterpiece professional photograph, ${light} meticulously crafted to sculpt the subject with soft shadows and catchlights in eyes, shot on ${camera}, 8k UHD, razor-sharp focus, breathtaking detail, uncompressed, color graded to perfection.`;
 
1298
  } else if (currentMode === 'children') {
1299
  const style = document.getElementById('child_style').value;
1300
  const shotType = document.getElementById('child_shotType').value;
1301
+ const location = document.querySelector('#childLocationSelector .style-btn.active').dataset.value;
1302
  const light = document.getElementById('child_light').value;
1303
  let subject = '';
1304
  let pose_info = '';
 
1324
  }
1325
 
1326
  fullPrompt = `${envKeyword}, style:: ${style}, luxury children's fashion campaign, cinematic storytelling, enchanting, ultra-photorealistic.
1327
+ composition:: ${shotType}. If 'Full body shot' is selected, the final image must show the child from head to toe, without cropping feet or head.
1328
  subject:: ${subject} The photograph must look like a cover shot for a high-end children's fashion magazine.
1329
+ clothing_focus:: CRITICAL INSTRUCTION - The child is wearing EXACTLY: ${clothing_details}. This description must be rendered with 1000% fidelity. For example, if 'anti-scratch mittens' are mentioned, the hands MUST be covered. If 'open-toed sandals' are mentioned, the toes MUST be visible. This is the most important instruction.
1330
+ texture_&_material_fidelity:: Macro-level detail on clothing textures as described above. Focus on the weave of cotton, the softness of wool fibers, the texture of denim. Show realistic wrinkles and creases from movement. Absolute texture fidelity to the description is crucial.
1331
+ human_realism_details:: Capture the pure, innocent beauty of the child. Hyper-realistic, dewy skin with a natural glow and visible texture, not airbrushed. The light should have a painterly, almost magical quality. Eyes must be expressive, with realistic reflections and depth. Individual hair strands should be visible.
1332
  scene_activity:: ${pose_info} The location is ${location}, creating a whimsical and high-end narrative.
1333
  technical:: Masterpiece photograph, ${light} creating a magical and soft atmosphere, shot on Fujifilm XT4, 56mm F1.2 lens, 8k, tack sharp focus, impeccable detail, perfect color grading, looks like a real captured moment of wonder from a luxury campaign.`;
1334
 
 
1350
  fullPrompt = `${envKeyword}, style:: Luxury product advertising, ${objectStyle}, sophisticated, sleek, ultra-photorealistic.
1351
  subject:: A breathtaking, hyper-realistic photograph of the luxury product: ${objectName}. The image must evoke desire and exclusivity, looking like a real, professionally shot advertisement.
1352
  material_focus:: Achieve 1000% physical accuracy with an emphasis on perfection. Render pristine, flawless surfaces with micro-scratches and realistic imperfections. Showcase the intricate details of the material grain, polished metal sheen with fingerprints, or crystal-clear refractions. Even microscopic dust particles should look clean and perfect.
1353
+ scene_context:: Placed ${background}. Additional details: It is MANDATORY to include the following details with perfect realism: ${objectDetails}. This description has the highest priority.
1354
  composition:: ${objectComposition}, creating a powerful and elegant visual statement.
1355
  technical:: Advertisement-grade photograph, ${objectLighting} designed to accentuate the product's luxury form and textures, 8k UHD resolution, flawless focus, extreme macro detail, advanced ray-traced reflections and caustics, impeccably clean, exudes quality and high-end appeal, masterpiece.`;
1356
  }