Setting to enable/disable VAE tiling

This commit is contained in:
cmdr2 2023-12-11 22:28:19 +05:30
parent 398a0509d7
commit 097780be26
4 changed files with 15 additions and 0 deletions

View File

@ -278,6 +278,11 @@ def generate_images_internal(
setattr(pipe.unet, "_allocate_trt_buffers_backup", pipe.unet._allocate_trt_buffers)
delattr(pipe.unet, "_allocate_trt_buffers")
if task_data.enable_vae_tiling:
pipe.enable_vae_tiling()
else:
pipe.disable_vae_tiling()
images = generate_images(context, callback=callback, **req.dict())
user_stopped = False
except UserInitiatedStop:

View File

@ -84,6 +84,7 @@ class RenderTaskData(TaskData):
filters: List[str] = []
filter_params: Dict[str, Dict[str, Any]] = {}
control_filter_to_apply: Union[str, List[str]] = None
enable_vae_tiling: bool = True
show_only_filtered_image: bool = False
block_nsfw: bool = False

View File

@ -387,6 +387,13 @@
<tr class="pl-5" id="output_quality_row"><td><label for="output_quality">Image Quality:</label></td><td>
<input id="output_quality_slider" name="output_quality" class="editor-slider" value="75" type="range" min="10" max="95"> <input id="output_quality" name="output_quality" size="4" pattern="^[0-9\.]+$" onkeypress="preventNonNumericalInput(event)" inputmode="numeric">
</td></tr>
<tr class="pl-5">
<td><label for="tiling">Enable VAE Tiling:</label></td>
<td class="diffusers-restart-needed">
<input id="enable_vae_tiling" name="enable_vae_tiling" type="checkbox" checked>
<label><small>Optimizes memory for larger images</small></label>
</td>
</tr>
</table></div>
<div><ul>

View File

@ -129,6 +129,7 @@ let hypernetworkStrengthField = document.querySelector("#hypernetwork_strength")
let outputFormatField = document.querySelector("#output_format")
let outputLosslessField = document.querySelector("#output_lossless")
let outputLosslessContainer = document.querySelector("#output_lossless_container")
let enableVAETilingField = document.querySelector("#enable_vae_tiling")
let blockNSFWField = document.querySelector("#block_nsfw")
let showOnlyFilteredImageField = document.querySelector("#show_only_filtered_image")
let updateBranchLabel = document.querySelector("#updateBranchLabel")
@ -1369,6 +1370,7 @@ function getCurrentUserRequest() {
if (tilingField.value !== "none") {
newTask.reqBody.tiling = tilingField.value
}
newTask.reqBody.enable_vae_tiling = enableVAETilingField.checked
}
if (testDiffusers.checked && document.getElementById("toggle-tensorrt-install").innerHTML == "Uninstall") {
// TRT is installed