()
| 1317 | } |
| 1318 | |
| 1319 | function getCurrentUserRequest() { |
| 1320 | const numOutputsTotal = parseInt(numOutputsTotalField.value) |
| 1321 | let numOutputsParallel = parseInt(numOutputsParallelField.value) |
| 1322 | const seed = randomSeedField.checked ? Math.floor(Math.random() * (2 ** 32 - 1)) : parseInt(seedField.value) |
| 1323 | |
| 1324 | // if ( |
| 1325 | // testDiffusers.checked && |
| 1326 | // document.getElementById("toggle-tensorrt-install").innerHTML == "Uninstall" && |
| 1327 | // document.querySelector("#convert_to_tensorrt").checked |
| 1328 | // ) { |
| 1329 | // // TRT enabled |
| 1330 | |
| 1331 | // numOutputsParallel = 1 // force 1 parallel |
| 1332 | // } |
| 1333 | |
| 1334 | // clamp to multiple of 8 |
| 1335 | let width = parseInt(widthField.value) |
| 1336 | let height = parseInt(heightField.value) |
| 1337 | width = width - (width % IMAGE_STEP_SIZE) |
| 1338 | height = height - (height % IMAGE_STEP_SIZE) |
| 1339 | |
| 1340 | const newTask = { |
| 1341 | batchesDone: 0, |
| 1342 | numOutputsTotal: numOutputsTotal, |
| 1343 | batchCount: Math.ceil(numOutputsTotal / numOutputsParallel), |
| 1344 | seed, |
| 1345 | reqBody: { |
| 1346 | seed, |
| 1347 | used_random_seed: randomSeedField.checked, |
| 1348 | negative_prompt: negativePromptField.value.trim(), |
| 1349 | num_outputs: numOutputsParallel, |
| 1350 | num_inference_steps: parseInt(numInferenceStepsField.value), |
| 1351 | guidance_scale: parseFloat(guidanceScaleField.value), |
| 1352 | width: width, |
| 1353 | height: height, |
| 1354 | // allow_nsfw: allowNSFWField.checked, |
| 1355 | vram_usage_level: vramUsageLevelField.value, |
| 1356 | sampler_name: samplerField.value, |
| 1357 | //render_device: undefined, // Set device affinity. Prefer this device, but wont activate. |
| 1358 | use_stable_diffusion_model: stableDiffusionModelField.value, |
| 1359 | clip_skip: clipSkipField.checked, |
| 1360 | use_vae_model: vaeModelField.value, |
| 1361 | stream_progress_updates: true, |
| 1362 | stream_image_progress: numOutputsTotal > 50 ? false : streamImageProgressField.checked, |
| 1363 | show_only_filtered_image: showOnlyFilteredImageField.checked, |
| 1364 | block_nsfw: blockNSFWField.checked, |
| 1365 | output_format: outputFormatField.value, |
| 1366 | output_quality: parseInt(outputQualityField.value), |
| 1367 | output_lossless: outputLosslessField.checked, |
| 1368 | metadata_output_format: metadataOutputFormatField.value, |
| 1369 | original_prompt: promptField.value, |
| 1370 | active_tags: activeTags.map((x) => x.name), |
| 1371 | inactive_tags: activeTags.filter((tag) => tag.inactive === true).map((x) => x.name), |
| 1372 | }, |
| 1373 | } |
| 1374 | if (IMAGE_REGEX.test(initImagePreview.src)) { |
| 1375 | newTask.reqBody.init_image = initImagePreview.src |
| 1376 | newTask.reqBody.prompt_strength = parseFloat(promptStrengthField.value) |
no test coverage detected