Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -864,6 +864,7 @@ select option {
|
|
| 864 |
<label>Эстетика</label>
|
| 865 |
<div id="styleSelector" class="style-grid">
|
| 866 |
<button type="button" class="style-btn active" data-value="Raw Candid Photography">Живое фото (Raw)</button>
|
|
|
|
| 867 |
<button type="button" class="style-btn" data-value="Cinematic Movie Still">Кадр из фильма</button>
|
| 868 |
<button type="button" class="style-btn" data-value="Fashion Editorial">Модный журнал</button>
|
| 869 |
<button type="button" class="style-btn" data-value="Street Style Photo">Уличный стиль</button>
|
|
@@ -1060,6 +1061,15 @@ select option {
|
|
| 1060 |
<option value="Vintage Analog Film">Пленка (Vintage)</option>
|
| 1061 |
</select>
|
| 1062 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1063 |
</div>
|
| 1064 |
|
| 1065 |
<div id="objectMode" class="form-mode">
|
|
@@ -1110,6 +1120,15 @@ select option {
|
|
| 1110 |
<div class="form-group full-width">
|
| 1111 |
<label for="object_details">Дополнительные детали окружения</label>
|
| 1112 |
<textarea id="object_details" placeholder="Пример: капли воды на флаконе, текстура кожи ремешка, гравировка на металле"></textarea>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1113 |
</div>
|
| 1114 |
<div class="form-group full-width">
|
| 1115 |
<label class="checkbox-label">Креативность</label>
|
|
@@ -1296,6 +1315,7 @@ technical:: Masterpiece professional photograph, ${light} meticulously crafted t
|
|
| 1296 |
}
|
| 1297 |
|
| 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;
|
|
@@ -1303,6 +1323,7 @@ technical:: Masterpiece professional photograph, ${light} meticulously crafted t
|
|
| 1303 |
let subject = '';
|
| 1304 |
let pose_info = '';
|
| 1305 |
let clothing_details = '';
|
|
|
|
| 1306 |
|
| 1307 |
if(currentChildrenSubMode === 'newborn') {
|
| 1308 |
const age = document.getElementById('newborn_age').value;
|
|
@@ -1312,6 +1333,7 @@ technical:: Masterpiece professional photograph, ${light} meticulously crafted t
|
|
| 1312 |
clothing_details = document.getElementById('newborn_details').value || "soft knitted fabric";
|
| 1313 |
subject = `An ultra-photorealistic portrait of a ${age} ${ethnicity} baby. Face expression is ${emotion}.`;
|
| 1314 |
pose_info = `The baby is ${pose}.`;
|
|
|
|
| 1315 |
} else {
|
| 1316 |
const age = document.getElementById('child_age').value;
|
| 1317 |
const gender = document.getElementById('child_gender').value;
|
|
@@ -1321,9 +1343,20 @@ technical:: Masterpiece professional photograph, ${light} meticulously crafted t
|
|
| 1321 |
clothing_details = document.getElementById('child_details').value || "detailed textured casual clothes";
|
| 1322 |
subject = `An ultra-photorealistic portrait of a ${age} ${ethnicity} ${gender}. Face expression is ${emotion}.`;
|
| 1323 |
pose_info = `The child is ${pose}.`;
|
|
|
|
| 1324 |
}
|
| 1325 |
-
|
| 1326 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.
|
|
@@ -1331,8 +1364,10 @@ texture_&_material_fidelity:: Macro-level detail on clothing textures as describ
|
|
| 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 |
|
| 1335 |
} else {
|
|
|
|
| 1336 |
const objectName = document.getElementById('object_name').value || "a product";
|
| 1337 |
const objectStyle = document.getElementById('object_style').value;
|
| 1338 |
const objectLighting = document.getElementById('object_lighting').value;
|
|
@@ -1346,13 +1381,24 @@ technical:: Masterpiece photograph, ${light} creating a magical and soft atmosph
|
|
| 1346 |
} else {
|
| 1347 |
background = document.getElementById('object_background').value;
|
| 1348 |
}
|
| 1349 |
-
|
| 1350 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
}
|
| 1357 |
|
| 1358 |
const cleanPrompt = fullPrompt.replace(/\\s+/g, ' ').replace(/\\n/g, ' ').trim();
|
|
|
|
| 864 |
<label>Эстетика</label>
|
| 865 |
<div id="styleSelector" class="style-grid">
|
| 866 |
<button type="button" class="style-btn active" data-value="Raw Candid Photography">Живое фото (Raw)</button>
|
| 867 |
+
<button type="button" class="style-btn" data-value="Candid mirror selfie shot on a smartphone, imperfect amateur photo, visible phone in reflection, harsh flash, grainy texture">Селфи у зеркала</button>
|
| 868 |
<button type="button" class="style-btn" data-value="Cinematic Movie Still">Кадр из фильма</button>
|
| 869 |
<button type="button" class="style-btn" data-value="Fashion Editorial">Модный журнал</button>
|
| 870 |
<button type="button" class="style-btn" data-value="Street Style Photo">Уличный стиль</button>
|
|
|
|
| 1061 |
<option value="Vintage Analog Film">Пленка (Vintage)</option>
|
| 1062 |
</select>
|
| 1063 |
</div>
|
| 1064 |
+
<div class="form-group full-width">
|
| 1065 |
+
<label class="checkbox-label">Детали одежды</label>
|
| 1066 |
+
<div class="checkbox-container">
|
| 1067 |
+
<input type="checkbox" id="child_clothing_details_checkbox">
|
| 1068 |
+
<label for="child_clothing_details_checkbox" style="color: var(--text); text-transform: none; letter-spacing: 0;">
|
| 1069 |
+
Сгенерировать коллаж с увеличенными деталями (ткань, фурнитура)
|
| 1070 |
+
</label>
|
| 1071 |
+
</div>
|
| 1072 |
+
</div>
|
| 1073 |
</div>
|
| 1074 |
|
| 1075 |
<div id="objectMode" class="form-mode">
|
|
|
|
| 1120 |
<div class="form-group full-width">
|
| 1121 |
<label for="object_details">Дополнительные детали окружения</label>
|
| 1122 |
<textarea id="object_details" placeholder="Пример: капли воды на флаконе, текстура кожи ремешка, гравировка на металле"></textarea>
|
| 1123 |
+
</div>
|
| 1124 |
+
<div class="form-group full-width">
|
| 1125 |
+
<label class="checkbox-label">Детали товара</label>
|
| 1126 |
+
<div class="checkbox-container">
|
| 1127 |
+
<input type="checkbox" id="object_details_checkbox">
|
| 1128 |
+
<label for="object_details_checkbox" style="color: var(--text); text-transform: none; letter-spacing: 0;">
|
| 1129 |
+
Сгенерировать коллаж с увеличенными деталями (текстура, материалы)
|
| 1130 |
+
</label>
|
| 1131 |
+
</div>
|
| 1132 |
</div>
|
| 1133 |
<div class="form-group full-width">
|
| 1134 |
<label class="checkbox-label">Креативность</label>
|
|
|
|
| 1315 |
}
|
| 1316 |
|
| 1317 |
} else if (currentMode === 'children') {
|
| 1318 |
+
const generateDetailsCollage = document.getElementById('child_clothing_details_checkbox').checked;
|
| 1319 |
const style = document.getElementById('child_style').value;
|
| 1320 |
const shotType = document.getElementById('child_shotType').value;
|
| 1321 |
const location = document.querySelector('#childLocationSelector .style-btn.active').dataset.value;
|
|
|
|
| 1323 |
let subject = '';
|
| 1324 |
let pose_info = '';
|
| 1325 |
let clothing_details = '';
|
| 1326 |
+
let main_image_description = '';
|
| 1327 |
|
| 1328 |
if(currentChildrenSubMode === 'newborn') {
|
| 1329 |
const age = document.getElementById('newborn_age').value;
|
|
|
|
| 1333 |
clothing_details = document.getElementById('newborn_details').value || "soft knitted fabric";
|
| 1334 |
subject = `An ultra-photorealistic portrait of a ${age} ${ethnicity} baby. Face expression is ${emotion}.`;
|
| 1335 |
pose_info = `The baby is ${pose}.`;
|
| 1336 |
+
main_image_description = `A ${shotType} of a cute ${age} ${ethnicity} baby, ${emotion}. The baby is ${pose}, wearing EXACTLY: ${clothing_details}.`
|
| 1337 |
} else {
|
| 1338 |
const age = document.getElementById('child_age').value;
|
| 1339 |
const gender = document.getElementById('child_gender').value;
|
|
|
|
| 1343 |
clothing_details = document.getElementById('child_details').value || "detailed textured casual clothes";
|
| 1344 |
subject = `An ultra-photorealistic portrait of a ${age} ${ethnicity} ${gender}. Face expression is ${emotion}.`;
|
| 1345 |
pose_info = `The child is ${pose}.`;
|
| 1346 |
+
main_image_description = `A ${shotType} of a ${age} ${ethnicity} ${gender}, ${emotion}. The child is ${pose}, wearing EXACTLY: ${clothing_details}.`
|
| 1347 |
}
|
| 1348 |
+
|
| 1349 |
+
if(generateDetailsCollage) {
|
| 1350 |
+
fullPrompt = `${envKeyword}, style:: A professional children's fashion lookbook page, ${style}, hyper-realistic photography, clean and minimalist layout.
|
| 1351 |
+
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.
|
| 1352 |
+
main_image_description:: ${main_image_description}. This description must be followed with 1000% fidelity.
|
| 1353 |
+
detail_shot_1_description:: A hyper-detailed macro photograph focusing on the raw texture of the fabric from the clothing described above (e.g., wool knit, cotton weave).
|
| 1354 |
+
detail_shot_2_description:: An extreme close-up of a key hardware detail from the clothing, such as a cute button, a small zipper, or an embroidered patch.
|
| 1355 |
+
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.
|
| 1356 |
+
environment_and_lighting:: The main image environment is ${location}. The lighting is ${light}.
|
| 1357 |
+
technical:: Each individual image in this collage is an 8k UHD masterpiece, shot on Fujifilm XT4, 56mm F1.2 lens, with perfect ${light}, and razor-sharp focus.`;
|
| 1358 |
+
} else {
|
| 1359 |
+
fullPrompt = `${envKeyword}, style:: ${style}, luxury children's fashion campaign, cinematic storytelling, enchanting, ultra-photorealistic.
|
| 1360 |
composition:: ${shotType}. If 'Full body shot' is selected, the final image must show the child from head to toe, without cropping feet or head.
|
| 1361 |
subject:: ${subject} The photograph must look like a cover shot for a high-end children's fashion magazine.
|
| 1362 |
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.
|
|
|
|
| 1364 |
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.
|
| 1365 |
scene_activity:: ${pose_info} The location is ${location}, creating a whimsical and high-end narrative.
|
| 1366 |
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.`;
|
| 1367 |
+
}
|
| 1368 |
|
| 1369 |
} else {
|
| 1370 |
+
const generateDetailsCollage = document.getElementById('object_details_checkbox').checked;
|
| 1371 |
const objectName = document.getElementById('object_name').value || "a product";
|
| 1372 |
const objectStyle = document.getElementById('object_style').value;
|
| 1373 |
const objectLighting = document.getElementById('object_lighting').value;
|
|
|
|
| 1381 |
} else {
|
| 1382 |
background = document.getElementById('object_background').value;
|
| 1383 |
}
|
| 1384 |
+
|
| 1385 |
+
if (generateDetailsCollage) {
|
| 1386 |
+
fullPrompt = `${envKeyword}, style:: A professional product lookbook page, ${objectStyle}, hyper-realistic photography, clean and minimalist layout with a lot of negative space.
|
| 1387 |
+
composition:: The final image is a collage. The main image occupies the top 70% of the canvas, it must be a medium shot of the product. Below the main image are three smaller, perfectly square detail shots arranged in a neat horizontal row. A clean background separates all images.
|
| 1388 |
+
main_image_description:: A medium shot of the luxury product: ${objectName}. Placed ${background}. Additional details: It is MANDATORY to include the following details with perfect realism: ${objectDetails}. This description has the highest priority.
|
| 1389 |
+
detail_shot_1_description:: A hyper-detailed macro photograph focusing on the raw texture of the product's primary material.
|
| 1390 |
+
detail_shot_2_description:: An extreme close-up of a key hardware detail from the product, such as an intricate logo, a metallic element, or a unique engraving.
|
| 1391 |
+
detail_shot_3_description:: A close-up shot showcasing the quality of the craftsmanship, focusing on the joints, stitching, or seams of the product described above.
|
| 1392 |
+
environment_and_lighting:: The main image lighting is ${objectLighting}.
|
| 1393 |
+
technical:: Each individual image in this collage is an 8k UHD advertisement-grade masterpiece with flawless focus.`;
|
| 1394 |
+
} else {
|
| 1395 |
+
fullPrompt = `${envKeyword}, style:: Luxury product advertising, ${objectStyle}, sophisticated, sleek, ultra-photorealistic.
|
| 1396 |
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.
|
| 1397 |
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.
|
| 1398 |
scene_context:: Placed ${background}. Additional details: It is MANDATORY to include the following details with perfect realism: ${objectDetails}. This description has the highest priority.
|
| 1399 |
composition:: ${objectComposition}, creating a powerful and elegant visual statement.
|
| 1400 |
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.`;
|
| 1401 |
+
}
|
| 1402 |
}
|
| 1403 |
|
| 1404 |
const cleanPrompt = fullPrompt.replace(/\\s+/g, ' ').replace(/\\n/g, ' ').trim();
|