Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -579,7 +579,7 @@ select, textarea, input[type="text"] {
|
|
| 579 |
box-sizing: border-box;
|
| 580 |
}
|
| 581 |
|
| 582 |
-
select:disabled, textarea:disabled, input[type="text"]:disabled {
|
| 583 |
background-color: #222;
|
| 584 |
opacity: 0.5;
|
| 585 |
cursor: not-allowed;
|
|
@@ -721,6 +721,47 @@ select option {
|
|
| 721 |
border-color: var(--primary);
|
| 722 |
box-shadow: 0 0 10px rgba(204, 255, 0, 0.3);
|
| 723 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 724 |
|
| 725 |
@media (max-width: 600px) {
|
| 726 |
.form-grid {
|
|
@@ -900,13 +941,40 @@ select option {
|
|
| 900 |
</div>
|
| 901 |
</div>
|
| 902 |
<div class="form-group full-width">
|
| 903 |
-
|
| 904 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 905 |
<input type="checkbox" id="clothing_details_checkbox">
|
| 906 |
<label for="clothing_details_checkbox" style="color: var(--text); text-transform: none; letter-spacing: 0;">
|
| 907 |
Сгенерировать коллаж с увеличенными деталями (ткань, фурнитура)
|
| 908 |
</label>
|
| 909 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 910 |
</div>
|
| 911 |
<div class="form-group full-width">
|
| 912 |
<label for="model_details">Одежда и Детали (Опишите ткань и фасон!)</label>
|
|
@@ -1062,13 +1130,40 @@ select option {
|
|
| 1062 |
</select>
|
| 1063 |
</div>
|
| 1064 |
<div class="form-group full-width">
|
| 1065 |
-
|
| 1066 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|
|
@@ -1120,6 +1215,27 @@ select option {
|
|
| 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>
|
|
@@ -1224,14 +1340,16 @@ function autoAdjustDefaults() {
|
|
| 1224 |
|
| 1225 |
function toggleMyModelMode() {
|
| 1226 |
const isMyModel = document.getElementById('my_model_checkbox').checked;
|
| 1227 |
-
const fieldsToToggle = ['gender', 'age', 'nationality', 'hairColor', 'hairstyle', 'emotion', 'clothing_details_checkbox'];
|
| 1228 |
|
| 1229 |
fieldsToToggle.forEach(fieldId => {
|
| 1230 |
const element = document.getElementById(fieldId);
|
| 1231 |
if (element) {
|
| 1232 |
element.disabled = isMyModel;
|
| 1233 |
-
if (
|
| 1234 |
element.checked = false;
|
|
|
|
|
|
|
| 1235 |
}
|
| 1236 |
}
|
| 1237 |
});
|
|
@@ -1243,30 +1361,63 @@ function toggleCreativeMode() {
|
|
| 1243 |
}
|
| 1244 |
|
| 1245 |
function setupClickableSelectors() {
|
| 1246 |
-
const
|
| 1247 |
-
|
| 1248 |
-
const container = document.getElementById(selectorId);
|
| 1249 |
if (!container) return;
|
| 1250 |
-
const buttons = container.querySelectorAll('.style-btn');
|
| 1251 |
|
| 1252 |
buttons.forEach(btn => {
|
| 1253 |
btn.addEventListener('click', () => {
|
| 1254 |
-
|
| 1255 |
btn.classList.add('active');
|
| 1256 |
});
|
| 1257 |
});
|
| 1258 |
});
|
| 1259 |
}
|
| 1260 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1261 |
|
| 1262 |
async function processAndOpen() {
|
| 1263 |
const btn = document.querySelector('.action-btn');
|
| 1264 |
const originalText = btn.innerHTML;
|
| 1265 |
let fullPrompt = '';
|
| 1266 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1267 |
if (currentMode === 'model') {
|
| 1268 |
const isMyModel = document.getElementById('my_model_checkbox').checked;
|
| 1269 |
const generateDetailsCollage = document.getElementById('clothing_details_checkbox').checked;
|
|
|
|
| 1270 |
const style = document.querySelector('#styleSelector .style-btn.active').dataset.value;
|
| 1271 |
const shotType = document.getElementById('shotType').value;
|
| 1272 |
const bodyType = document.getElementById('bodyType').value;
|
|
@@ -1303,11 +1454,21 @@ Final Scene: Place the model in the following environment: ${location}.
|
|
| 1303 |
Lighting: The scene must have ${light}.
|
| 1304 |
Technical: Masterpiece professional photograph, shot on ${camera}, 8k UHD, razor-sharp focus, extreme detail, perfect color grading, no digital artifacts.`;
|
| 1305 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1306 |
fullPrompt = `${envKeyword}, style:: ${style}, high fashion editorial, luxury brand campaign (like Dior, D&G), Vogue aesthetic, hyper-realistic photography, award-winning.
|
| 1307 |
-
composition:: ${
|
| 1308 |
-
subject::
|
| 1309 |
-
|
| 1310 |
-
clothing_focus:: HIGHEST PRIORITY - The model
|
| 1311 |
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.
|
| 1312 |
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.
|
| 1313 |
scene_environment:: ${location}, creating a sophisticated and aspirational atmosphere.
|
|
@@ -1316,18 +1477,21 @@ technical:: Masterpiece professional photograph, ${light} meticulously crafted t
|
|
| 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 |
-
|
| 1321 |
const location = document.querySelector('#childLocationSelector .style-btn.active').dataset.value;
|
| 1322 |
const light = document.getElementById('child_light').value;
|
| 1323 |
let subject = '';
|
| 1324 |
let pose_info = '';
|
| 1325 |
let clothing_details = '';
|
| 1326 |
let main_image_description = '';
|
|
|
|
|
|
|
| 1327 |
|
| 1328 |
if(currentChildrenSubMode === 'newborn') {
|
| 1329 |
-
|
| 1330 |
-
|
| 1331 |
const emotion = document.getElementById('newborn_emotion').value;
|
| 1332 |
const pose = document.getElementById('newborn_pose').value;
|
| 1333 |
clothing_details = document.getElementById('newborn_details').value || "soft knitted fabric";
|
|
@@ -1335,9 +1499,9 @@ technical:: Masterpiece professional photograph, ${light} meticulously crafted t
|
|
| 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 |
-
|
| 1339 |
const gender = document.getElementById('child_gender').value;
|
| 1340 |
-
|
| 1341 |
const emotion = document.getElementById('child_emotion').value;
|
| 1342 |
const pose = document.getElementById('child_pose').value;
|
| 1343 |
clothing_details = document.getElementById('child_details').value || "detailed textured casual clothes";
|
|
@@ -1355,6 +1519,20 @@ detail_shot_2_description:: An extreme close-up of a key hardware detail from th
|
|
| 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.
|
|
@@ -1401,6 +1579,7 @@ technical:: Advertisement-grade photograph, ${objectLighting} designed to accent
|
|
| 1401 |
}
|
| 1402 |
}
|
| 1403 |
|
|
|
|
| 1404 |
const cleanPrompt = fullPrompt.replace(/\\s+/g, ' ').replace(/\\n/g, ' ').trim();
|
| 1405 |
|
| 1406 |
try {
|
|
@@ -1428,6 +1607,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
| 1428 |
switchChildrenSubMode('newborn');
|
| 1429 |
autoAdjustDefaults();
|
| 1430 |
setupClickableSelectors();
|
|
|
|
|
|
|
| 1431 |
});
|
| 1432 |
</script>
|
| 1433 |
|
|
|
|
| 579 |
box-sizing: border-box;
|
| 580 |
}
|
| 581 |
|
| 582 |
+
select:disabled, textarea:disabled, input[type="text"]:disabled, input[type="checkbox"]:disabled + label {
|
| 583 |
background-color: #222;
|
| 584 |
opacity: 0.5;
|
| 585 |
cursor: not-allowed;
|
|
|
|
| 721 |
border-color: var(--primary);
|
| 722 |
box-shadow: 0 0 10px rgba(204, 255, 0, 0.3);
|
| 723 |
}
|
| 724 |
+
.aspect-ratio-grid {
|
| 725 |
+
display: grid;
|
| 726 |
+
grid-template-columns: repeat(4, 1fr);
|
| 727 |
+
gap: 10px;
|
| 728 |
+
}
|
| 729 |
+
.aspect-ratio-btn {
|
| 730 |
+
display: flex;
|
| 731 |
+
flex-direction: column;
|
| 732 |
+
align-items: center;
|
| 733 |
+
justify-content: center;
|
| 734 |
+
gap: 8px;
|
| 735 |
+
padding: 10px;
|
| 736 |
+
background-color: var(--input-bg);
|
| 737 |
+
border: 1px solid var(--border);
|
| 738 |
+
color: var(--text-secondary);
|
| 739 |
+
font-size: 0.8rem;
|
| 740 |
+
font-weight: 600;
|
| 741 |
+
cursor: pointer;
|
| 742 |
+
border-radius: 8px;
|
| 743 |
+
transition: all 0.3s ease;
|
| 744 |
+
text-align: center;
|
| 745 |
+
height: 90px;
|
| 746 |
+
}
|
| 747 |
+
.aspect-ratio-btn .preview {
|
| 748 |
+
background: #333;
|
| 749 |
+
border-radius: 3px;
|
| 750 |
+
transition: background-color 0.3s ease;
|
| 751 |
+
}
|
| 752 |
+
.aspect-ratio-btn:hover {
|
| 753 |
+
border-color: var(--primary);
|
| 754 |
+
color: var(--text);
|
| 755 |
+
}
|
| 756 |
+
.aspect-ratio-btn.active {
|
| 757 |
+
background-color: var(--primary);
|
| 758 |
+
color: #000;
|
| 759 |
+
border-color: var(--primary);
|
| 760 |
+
box-shadow: 0 0 10px rgba(204, 255, 0, 0.3);
|
| 761 |
+
}
|
| 762 |
+
.aspect-ratio-btn.active .preview {
|
| 763 |
+
background: #000;
|
| 764 |
+
}
|
| 765 |
|
| 766 |
@media (max-width: 600px) {
|
| 767 |
.form-grid {
|
|
|
|
| 941 |
</div>
|
| 942 |
</div>
|
| 943 |
<div class="form-group full-width">
|
| 944 |
+
<label>Соотношение сторон</label>
|
| 945 |
+
<div id="aspectRatioSelectorModel" class="aspect-ratio-grid">
|
| 946 |
+
<button type="button" class="aspect-ratio-btn active" data-value="--ar 9:16">
|
| 947 |
+
<div class="preview" style="width: 27px; height: 48px;"></div>
|
| 948 |
+
<span>9:16</span>
|
| 949 |
+
</button>
|
| 950 |
+
<button type="button" class="aspect-ratio-btn" data-value="--ar 1:1">
|
| 951 |
+
<div class="preview" style="width: 40px; height: 40px;"></div>
|
| 952 |
+
<span>1:1</span>
|
| 953 |
+
</button>
|
| 954 |
+
<button type="button" class="aspect-ratio-btn" data-value="--ar 3:4">
|
| 955 |
+
<div class="preview" style="width: 36px; height: 48px;"></div>
|
| 956 |
+
<span>3:4</span>
|
| 957 |
+
</button>
|
| 958 |
+
<button type="button" class="aspect-ratio-btn" data-value="--ar 16:9">
|
| 959 |
+
<div class="preview" style="width: 64px; height: 36px;"></div>
|
| 960 |
+
<span>16:9</span>
|
| 961 |
+
</button>
|
| 962 |
+
</div>
|
| 963 |
+
</div>
|
| 964 |
+
<div class="form-group full-width">
|
| 965 |
+
<label class="checkbox-label">Детали и Вариации</label>
|
| 966 |
+
<div class="checkbox-container" style="margin-bottom: 10px;">
|
| 967 |
<input type="checkbox" id="clothing_details_checkbox">
|
| 968 |
<label for="clothing_details_checkbox" style="color: var(--text); text-transform: none; letter-spacing: 0;">
|
| 969 |
Сгенерировать коллаж с увеличенными деталями (ткань, фурнитура)
|
| 970 |
</label>
|
| 971 |
</div>
|
| 972 |
+
<div class="checkbox-container">
|
| 973 |
+
<input type="checkbox" id="multiple_variants_checkbox">
|
| 974 |
+
<label for="multiple_variants_checkbox" style="color: var(--text); text-transform: none; letter-spacing: 0;">
|
| 975 |
+
Разные варианты/цвета (несколько моделей в кадре)
|
| 976 |
+
</label>
|
| 977 |
+
</div>
|
| 978 |
</div>
|
| 979 |
<div class="form-group full-width">
|
| 980 |
<label for="model_details">Одежда и Детали (Опишите ткань и фасон!)</label>
|
|
|
|
| 1130 |
</select>
|
| 1131 |
</div>
|
| 1132 |
<div class="form-group full-width">
|
| 1133 |
+
<label>Соотношение сторон</label>
|
| 1134 |
+
<div id="aspectRatioSelectorChildren" class="aspect-ratio-grid">
|
| 1135 |
+
<button type="button" class="aspect-ratio-btn active" data-value="--ar 9:16">
|
| 1136 |
+
<div class="preview" style="width: 27px; height: 48px;"></div>
|
| 1137 |
+
<span>9:16</span>
|
| 1138 |
+
</button>
|
| 1139 |
+
<button type="button" class="aspect-ratio-btn" data-value="--ar 1:1">
|
| 1140 |
+
<div class="preview" style="width: 40px; height: 40px;"></div>
|
| 1141 |
+
<span>1:1</span>
|
| 1142 |
+
</button>
|
| 1143 |
+
<button type="button" class="aspect-ratio-btn" data-value="--ar 3:4">
|
| 1144 |
+
<div class="preview" style="width: 36px; height: 48px;"></div>
|
| 1145 |
+
<span>3:4</span>
|
| 1146 |
+
</button>
|
| 1147 |
+
<button type="button" class="aspect-ratio-btn" data-value="--ar 16:9">
|
| 1148 |
+
<div class="preview" style="width: 64px; height: 36px;"></div>
|
| 1149 |
+
<span>16:9</span>
|
| 1150 |
+
</button>
|
| 1151 |
+
</div>
|
| 1152 |
+
</div>
|
| 1153 |
+
<div class="form-group full-width">
|
| 1154 |
+
<label class="checkbox-label">Детали и Вариации</label>
|
| 1155 |
+
<div class="checkbox-container" style="margin-bottom: 10px;">
|
| 1156 |
<input type="checkbox" id="child_clothing_details_checkbox">
|
| 1157 |
<label for="child_clothing_details_checkbox" style="color: var(--text); text-transform: none; letter-spacing: 0;">
|
| 1158 |
Сгенерировать коллаж с увеличенными деталями (ткань, фурнитура)
|
| 1159 |
</label>
|
| 1160 |
</div>
|
| 1161 |
+
<div class="checkbox-container">
|
| 1162 |
+
<input type="checkbox" id="child_multiple_variants_checkbox">
|
| 1163 |
+
<label for="child_multiple_variants_checkbox" style="color: var(--text); text-transform: none; letter-spacing: 0;">
|
| 1164 |
+
Разные варианты/цвета (несколько моделей в кадре)
|
| 1165 |
+
</label>
|
| 1166 |
+
</div>
|
| 1167 |
</div>
|
| 1168 |
</div>
|
| 1169 |
|
|
|
|
| 1215 |
<div class="form-group full-width">
|
| 1216 |
<label for="object_details">Дополнительные детали окружения</label>
|
| 1217 |
<textarea id="object_details" placeholder="Пример: капли воды на флаконе, текстура кожи ремешка, гравировка на металле"></textarea>
|
| 1218 |
+
</div>
|
| 1219 |
+
<div class="form-group full-width">
|
| 1220 |
+
<label>Соотношение сторон</label>
|
| 1221 |
+
<div id="aspectRatioSelectorObject" class="aspect-ratio-grid">
|
| 1222 |
+
<button type="button" class="aspect-ratio-btn active" data-value="--ar 9:16">
|
| 1223 |
+
<div class="preview" style="width: 27px; height: 48px;"></div>
|
| 1224 |
+
<span>9:16</span>
|
| 1225 |
+
</button>
|
| 1226 |
+
<button type="button" class="aspect-ratio-btn" data-value="--ar 1:1">
|
| 1227 |
+
<div class="preview" style="width: 40px; height: 40px;"></div>
|
| 1228 |
+
<span>1:1</span>
|
| 1229 |
+
</button>
|
| 1230 |
+
<button type="button" class="aspect-ratio-btn" data-value="--ar 3:4">
|
| 1231 |
+
<div class="preview" style="width: 36px; height: 48px;"></div>
|
| 1232 |
+
<span>3:4</span>
|
| 1233 |
+
</button>
|
| 1234 |
+
<button type="button" class="aspect-ratio-btn" data-value="--ar 16:9">
|
| 1235 |
+
<div class="preview" style="width: 64px; height: 36px;"></div>
|
| 1236 |
+
<span>16:9</span>
|
| 1237 |
+
</button>
|
| 1238 |
+
</div>
|
| 1239 |
</div>
|
| 1240 |
<div class="form-group full-width">
|
| 1241 |
<label class="checkbox-label">Детали товара</label>
|
|
|
|
| 1340 |
|
| 1341 |
function toggleMyModelMode() {
|
| 1342 |
const isMyModel = document.getElementById('my_model_checkbox').checked;
|
| 1343 |
+
const fieldsToToggle = ['gender', 'age', 'nationality', 'hairColor', 'hairstyle', 'emotion', 'clothing_details_checkbox', 'multiple_variants_checkbox'];
|
| 1344 |
|
| 1345 |
fieldsToToggle.forEach(fieldId => {
|
| 1346 |
const element = document.getElementById(fieldId);
|
| 1347 |
if (element) {
|
| 1348 |
element.disabled = isMyModel;
|
| 1349 |
+
if (element.type === 'checkbox' && isMyModel) {
|
| 1350 |
element.checked = false;
|
| 1351 |
+
const event = new Event('change');
|
| 1352 |
+
element.dispatchEvent(event);
|
| 1353 |
}
|
| 1354 |
}
|
| 1355 |
});
|
|
|
|
| 1361 |
}
|
| 1362 |
|
| 1363 |
function setupClickableSelectors() {
|
| 1364 |
+
const selectorGroups = document.querySelectorAll('.style-grid, .aspect-ratio-grid');
|
| 1365 |
+
selectorGroups.forEach(container => {
|
|
|
|
| 1366 |
if (!container) return;
|
| 1367 |
+
const buttons = container.querySelectorAll('.style-btn, .aspect-ratio-btn');
|
| 1368 |
|
| 1369 |
buttons.forEach(btn => {
|
| 1370 |
btn.addEventListener('click', () => {
|
| 1371 |
+
container.querySelectorAll('.style-btn, .aspect-ratio-btn').forEach(innerBtn => innerBtn.classList.remove('active'));
|
| 1372 |
btn.classList.add('active');
|
| 1373 |
});
|
| 1374 |
});
|
| 1375 |
});
|
| 1376 |
}
|
| 1377 |
|
| 1378 |
+
function setupCheckboxLogic(variantsId, collageId) {
|
| 1379 |
+
const variantsCheckbox = document.getElementById(variantsId);
|
| 1380 |
+
const collageCheckbox = document.getElementById(collageId);
|
| 1381 |
+
if (!variantsCheckbox || !collageCheckbox) return;
|
| 1382 |
+
|
| 1383 |
+
variantsCheckbox.addEventListener('change', () => {
|
| 1384 |
+
if (variantsCheckbox.checked) {
|
| 1385 |
+
collageCheckbox.checked = false;
|
| 1386 |
+
collageCheckbox.disabled = true;
|
| 1387 |
+
} else {
|
| 1388 |
+
collageCheckbox.disabled = false;
|
| 1389 |
+
}
|
| 1390 |
+
});
|
| 1391 |
+
|
| 1392 |
+
collageCheckbox.addEventListener('change', () => {
|
| 1393 |
+
if (collageCheckbox.checked) {
|
| 1394 |
+
variantsCheckbox.checked = false;
|
| 1395 |
+
variantsCheckbox.disabled = true;
|
| 1396 |
+
} else {
|
| 1397 |
+
variantsCheckbox.disabled = false;
|
| 1398 |
+
}
|
| 1399 |
+
});
|
| 1400 |
+
}
|
| 1401 |
+
|
| 1402 |
|
| 1403 |
async function processAndOpen() {
|
| 1404 |
const btn = document.querySelector('.action-btn');
|
| 1405 |
const originalText = btn.innerHTML;
|
| 1406 |
let fullPrompt = '';
|
| 1407 |
|
| 1408 |
+
let aspectRatio = '';
|
| 1409 |
+
if (currentMode === 'model') {
|
| 1410 |
+
aspectRatio = document.querySelector('#aspectRatioSelectorModel .aspect-ratio-btn.active').dataset.value;
|
| 1411 |
+
} else if (currentMode === 'children') {
|
| 1412 |
+
aspectRatio = document.querySelector('#aspectRatioSelectorChildren .aspect-ratio-btn.active').dataset.value;
|
| 1413 |
+
} else {
|
| 1414 |
+
aspectRatio = document.querySelector('#aspectRatioSelectorObject .aspect-ratio-btn.active').dataset.value;
|
| 1415 |
+
}
|
| 1416 |
+
|
| 1417 |
if (currentMode === 'model') {
|
| 1418 |
const isMyModel = document.getElementById('my_model_checkbox').checked;
|
| 1419 |
const generateDetailsCollage = document.getElementById('clothing_details_checkbox').checked;
|
| 1420 |
+
const generateMultipleVariants = document.getElementById('multiple_variants_checkbox').checked;
|
| 1421 |
const style = document.querySelector('#styleSelector .style-btn.active').dataset.value;
|
| 1422 |
const shotType = document.getElementById('shotType').value;
|
| 1423 |
const bodyType = document.getElementById('bodyType').value;
|
|
|
|
| 1454 |
Lighting: The scene must have ${light}.
|
| 1455 |
Technical: Masterpiece professional photograph, shot on ${camera}, 8k UHD, razor-sharp focus, extreme detail, perfect color grading, no digital artifacts.`;
|
| 1456 |
} else {
|
| 1457 |
+
let subject_base = `An ultra-high-resolution, flawless photograph of a striking ${age} ${nationality} ${gender} high fashion model.`;
|
| 1458 |
+
let composition_base = shotType;
|
| 1459 |
+
let model_characteristics_base = `model_characteristics:: physique ${bodyType}, ${hairColor} ${hairstyle} with individual strands visible and natural flyaways, expression ${emotion} (powerful yet serene), pose ${pose}.`;
|
| 1460 |
+
|
| 1461 |
+
if(generateMultipleVariants) {
|
| 1462 |
+
subject_base = `An ultra-high-resolution, flawless photograph of a group of 3 different but ethnically similar (${nationality}) high fashion models standing together in a line, each with a different natural pose and expression.`;
|
| 1463 |
+
composition_base = 'Full body shot, wide angle';
|
| 1464 |
+
model_characteristics_base = `model_characteristics:: All models have a similar ${bodyType} physique and look to be around ${age}.`;
|
| 1465 |
+
}
|
| 1466 |
+
|
| 1467 |
fullPrompt = `${envKeyword}, style:: ${style}, high fashion editorial, luxury brand campaign (like Dior, D&G), Vogue aesthetic, hyper-realistic photography, award-winning.
|
| 1468 |
+
composition:: ${composition_base}. The image must clearly show the models from head to toe without any part of the body being cropped.
|
| 1469 |
+
subject:: ${subject_base}
|
| 1470 |
+
${model_characteristics_base}
|
| 1471 |
+
clothing_focus:: HIGHEST PRIORITY - The model (or models) are wearing EXACTLY: ${details}. If multiple models are present, each wears a different color or minor style variant of this primary clothing description. This description is absolute and must be followed with 1000% accuracy, overriding any other assumptions. Physical accuracy of the described items is critical.
|
| 1472 |
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.
|
| 1473 |
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.
|
| 1474 |
scene_environment:: ${location}, creating a sophisticated and aspirational atmosphere.
|
|
|
|
| 1477 |
|
| 1478 |
} else if (currentMode === 'children') {
|
| 1479 |
const generateDetailsCollage = document.getElementById('child_clothing_details_checkbox').checked;
|
| 1480 |
+
const generateMultipleVariants = document.getElementById('child_multiple_variants_checkbox').checked;
|
| 1481 |
const style = document.getElementById('child_style').value;
|
| 1482 |
+
let shotType = document.getElementById('child_shotType').value;
|
| 1483 |
const location = document.querySelector('#childLocationSelector .style-btn.active').dataset.value;
|
| 1484 |
const light = document.getElementById('child_light').value;
|
| 1485 |
let subject = '';
|
| 1486 |
let pose_info = '';
|
| 1487 |
let clothing_details = '';
|
| 1488 |
let main_image_description = '';
|
| 1489 |
+
|
| 1490 |
+
let age, ethnicity;
|
| 1491 |
|
| 1492 |
if(currentChildrenSubMode === 'newborn') {
|
| 1493 |
+
age = document.getElementById('newborn_age').value;
|
| 1494 |
+
ethnicity = document.getElementById('newborn_ethnicity').value;
|
| 1495 |
const emotion = document.getElementById('newborn_emotion').value;
|
| 1496 |
const pose = document.getElementById('newborn_pose').value;
|
| 1497 |
clothing_details = document.getElementById('newborn_details').value || "soft knitted fabric";
|
|
|
|
| 1499 |
pose_info = `The baby is ${pose}.`;
|
| 1500 |
main_image_description = `A ${shotType} of a cute ${age} ${ethnicity} baby, ${emotion}. The baby is ${pose}, wearing EXACTLY: ${clothing_details}.`
|
| 1501 |
} else {
|
| 1502 |
+
age = document.getElementById('child_age').value;
|
| 1503 |
const gender = document.getElementById('child_gender').value;
|
| 1504 |
+
ethnicity = document.getElementById('child_ethnicity').value;
|
| 1505 |
const emotion = document.getElementById('child_emotion').value;
|
| 1506 |
const pose = document.getElementById('child_pose').value;
|
| 1507 |
clothing_details = document.getElementById('child_details').value || "detailed textured casual clothes";
|
|
|
|
| 1519 |
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.
|
| 1520 |
environment_and_lighting:: The main image environment is ${location}. The lighting is ${light}.
|
| 1521 |
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.`;
|
| 1522 |
+
} else if (generateMultipleVariants) {
|
| 1523 |
+
shotType = 'Full body shot, wide angle';
|
| 1524 |
+
subject = `An ultra-photorealistic portrait of 3 different children of similar age (${age}) and ethnicity (${ethnicity}). They are playing and laughing together.`;
|
| 1525 |
+
pose_info = `The children are interacting naturally together in various playful poses.`;
|
| 1526 |
+
|
| 1527 |
+
fullPrompt = `${envKeyword}, style:: ${style}, luxury children's fashion campaign, cinematic storytelling, enchanting, ultra-photorealistic.
|
| 1528 |
+
composition:: ${shotType}. The final image must show all children from head to toe, without cropping feet or head.
|
| 1529 |
+
subject:: ${subject} The photograph must look like a cover shot for a high-end children's fashion magazine.
|
| 1530 |
+
clothing_focus:: CRITICAL INSTRUCTION - The children are wearing EXACTLY: ${clothing_details}. Each child wears a different color variant of this outfit. This description must be rendered with 1000% fidelity. This is the most important instruction.
|
| 1531 |
+
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.
|
| 1532 |
+
human_realism_details:: Capture the pure, innocent beauty of the children. 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.
|
| 1533 |
+
scene_activity:: ${pose_info} The location is ${location}, creating a whimsical and high-end narrative.
|
| 1534 |
+
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.`;
|
| 1535 |
+
|
| 1536 |
} else {
|
| 1537 |
fullPrompt = `${envKeyword}, style:: ${style}, luxury children's fashion campaign, cinematic storytelling, enchanting, ultra-photorealistic.
|
| 1538 |
composition:: ${shotType}. If 'Full body shot' is selected, the final image must show the child from head to toe, without cropping feet or head.
|
|
|
|
| 1579 |
}
|
| 1580 |
}
|
| 1581 |
|
| 1582 |
+
fullPrompt = `${fullPrompt} ${aspectRatio}`;
|
| 1583 |
const cleanPrompt = fullPrompt.replace(/\\s+/g, ' ').replace(/\\n/g, ' ').trim();
|
| 1584 |
|
| 1585 |
try {
|
|
|
|
| 1607 |
switchChildrenSubMode('newborn');
|
| 1608 |
autoAdjustDefaults();
|
| 1609 |
setupClickableSelectors();
|
| 1610 |
+
setupCheckboxLogic('multiple_variants_checkbox', 'clothing_details_checkbox');
|
| 1611 |
+
setupCheckboxLogic('child_multiple_variants_checkbox', 'child_clothing_details_checkbox');
|
| 1612 |
});
|
| 1613 |
</script>
|
| 1614 |
|