Skip to content

Commit

Permalink
Better Continuous Generation settings, disable inference interrupted …
Browse files Browse the repository at this point in the history
…popup while continuous gen is active
  • Loading branch information
Stax124 committed May 22, 2023
1 parent 3eb11fd commit dd42c25
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 18 deletions.
13 changes: 7 additions & 6 deletions core/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,14 @@ def generate_thread_call(job: Job) -> Union[List[Image.Image], List[str]]:

return (images, deltatime)
except InferenceInterruptedError:
await websocket_manager.broadcast(
Notification(
"warning",
"Inference interrupted",
"The inference was forcefully interrupted",
if config.frontend.on_change_timer == 0:
await websocket_manager.broadcast(
Notification(
"warning",
"Inference interrupted",
"The inference was forcefully interrupted",
)
)
)
return ([], 0.0)

except ValueError as err:
Expand Down
7 changes: 5 additions & 2 deletions frontend/dist/assets/SettingsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2917,16 +2917,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "GeneralSettings",
setup(__props) {
const settings = useSettings();
watch(settings.defaultSettings.frontend, () => {
settings.data.settings.frontend.on_change_timer = settings.defaultSettings.frontend.on_change_timer;
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(NForm), null, {
default: withCtx(() => [
_hoisted_1$1,
createVNode(unref(NFormItem), { label: "Continuous generation timeout (0 for disabled)" }, {
createVNode(unref(NFormItem), { label: "Continuous generation timeout (0 for disabled) [ms]" }, {
default: withCtx(() => [
createVNode(unref(NInputNumber), {
value: unref(settings).defaultSettings.frontend.on_change_timer,
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => unref(settings).defaultSettings.frontend.on_change_timer = $event),
min: 100,
min: 0,
step: 50
}, null, 8, ["value"])
]),
Expand Down
4 changes: 2 additions & 2 deletions frontend/dist/assets/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
margin-left: 16px;
}

.main[data-v-fedbc04b] {
background-color: var(--33343887);
.main[data-v-9bd83b27] {
background-color: var(--37d47be4);
}
body {
min-height: 100vh;
Expand Down
15 changes: 10 additions & 5 deletions frontend/dist/assets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,8 @@ function flushJobs(seen2) {
}
}
}
/* @__PURE__ */ new Set();
/* @__PURE__ */ new Map();
function emit(instance, event, ...rawArgs) {
if (instance.isUnmounted)
return;
Expand Down Expand Up @@ -5881,7 +5883,7 @@ function normalizeContainer(container) {
}
var isVue2 = false;
/*!
* pinia v2.0.34
* pinia v2.0.35
* (c) 2023 Eduardo San Martin Morote
* @license MIT
*/
Expand Down Expand Up @@ -6569,6 +6571,7 @@ const render$1 = (r, ...args) => {
return null;
}
};
/* @__PURE__ */ new Set();
function warn$2(location2, message) {
console.error(`[naive/${location2}]: ${message}`);
}
Expand Down Expand Up @@ -8348,6 +8351,7 @@ const clickoutside = {
}
};
const clickoutside$1 = clickoutside;
/* @__PURE__ */ new Set();
function warn$1(location2, message) {
console.error(`[vdirs/${location2}]: ${message}`);
}
Expand Down Expand Up @@ -36585,6 +36589,7 @@ function useEventListener(...args) {
const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
const globalKey = "__vueuse_ssr_handlers__";
_global[globalKey] = _global[globalKey] || {};
/* @__PURE__ */ new Map();
var SwipeDirection;
(function(SwipeDirection2) {
SwipeDirection2["UP"] = "UP";
Expand Down Expand Up @@ -38138,12 +38143,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "App",
setup(__props) {
useCssVars((_ctx) => ({
"33343887": unref(backgroundColor)
"37d47be4": unref(backgroundColor)
}));
const settings = useSettings();
const theme = computed(() => {
if (settings.data.settings.frontend.theme === "dark") {
document.body.style.backgroundColor = "black";
document.body.style.backgroundColor = "#121215";
return darkTheme;
} else {
document.body.style.backgroundColor = "white";
Expand Down Expand Up @@ -38190,8 +38195,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
};
}
});
const App_vue_vue_type_style_index_0_scoped_fedbc04b_lang = "";
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fedbc04b"]]);
const App_vue_vue_type_style_index_0_scoped_9bd83b27_lang = "";
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9bd83b27"]]);
const scriptRel = "modulepreload";
const assetsURL = function(dep) {
return "/" + dep;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const settings = useSettings();
const theme = computed(() => {
if (settings.data.settings.frontend.theme === "dark") {
document.body.style.backgroundColor = "black";
document.body.style.backgroundColor = "#121215";
return darkTheme;
} else {
document.body.style.backgroundColor = "white";
Expand Down
10 changes: 8 additions & 2 deletions frontend/src/components/settings/GeneralSettings.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<NForm>
<h2>Timers</h2>
<NFormItem label="Continuous generation timeout (0 for disabled)">
<NFormItem label="Continuous generation timeout (0 for disabled) [ms]">
<NInputNumber
v-model:value="settings.defaultSettings.frontend.on_change_timer"
:min="100"
:min="0"
:step="50"
/>
</NFormItem>
Expand All @@ -13,7 +13,13 @@

<script setup lang="ts">
import { NForm, NFormItem, NInputNumber } from "naive-ui";
import { watch } from "vue";
import { useSettings } from "../../store/settings";
const settings = useSettings();
watch(settings.defaultSettings.frontend, () => {
settings.data.settings.frontend.on_change_timer =
settings.defaultSettings.frontend.on_change_timer;
});
</script>

0 comments on commit dd42c25

Please sign in to comment.