diff --git a/web/pages/GenerationPresets/index.tsx b/web/pages/GenerationPresets/index.tsx
index a1dd0fdaa..d499ef6cb 100644
--- a/web/pages/GenerationPresets/index.tsx
+++ b/web/pages/GenerationPresets/index.tsx
@@ -26,7 +26,7 @@ export const GenerationPresetsPage: Component = () => {
const [selecting, setSelecting] = createSignal(false)
const [deleting, setDeleting] = createSignal(false)
- const [store, setStore] = getPresetEditor()
+ const [store, setStore, hides] = getPresetEditor()
const onEdit = (preset: AppSchema.UserGenPreset) => {
nav(`/presets/${preset._id}`)
@@ -169,7 +169,7 @@ export const GenerationPresetsPage: Component = () => {
parentClass="mb-2"
/>
-
+
diff --git a/web/pages/Profile/SubscriptionPage.tsx b/web/pages/Profile/SubscriptionPage.tsx
index d9ca2a27e..86f36d17f 100644
--- a/web/pages/Profile/SubscriptionPage.tsx
+++ b/web/pages/Profile/SubscriptionPage.tsx
@@ -126,6 +126,11 @@ export const SubscriptionPage: Component<{}> = (props) => {
0}>
Current Subscription
+
+
+ Update Payment Method
+
+
diff --git a/web/pages/Settings/AISettings.tsx b/web/pages/Settings/AISettings.tsx
index f28ca6c85..97d6b0dcc 100644
--- a/web/pages/Settings/AISettings.tsx
+++ b/web/pages/Settings/AISettings.tsx
@@ -119,7 +119,7 @@ const AISettings: Component<{
value={!props.state.disableLTM}
label="Enable Embeddings/Long-Term Memory"
helperMarkdown={`Improves site performance when disabled. Disable long-term memory if your chat is _laggy_ and unresponsive.`}
- onChange={(ev) => props.setter('disableLTM', ev)}
+ onChange={(ev) => props.setter('disableLTM', !ev)}
/>
diff --git a/web/pages/Settings/Image/ImageSettings.tsx b/web/pages/Settings/Image/ImageSettings.tsx
index 657bba199..ce74f1611 100644
--- a/web/pages/Settings/Image/ImageSettings.tsx
+++ b/web/pages/Settings/Image/ImageSettings.tsx
@@ -1,20 +1,5 @@
-import {
- Component,
- Match,
- Show,
- Switch,
- createEffect,
- createMemo,
- createSignal,
- on,
- onMount,
-} from 'solid-js'
-import {
- NOVEL_IMAGE_MODEL,
- NOVEL_SAMPLER_REV,
- SD_SAMPLER,
- SD_SAMPLER_REV,
-} from '../../../../common/image'
+import { Match, Show, Switch, createEffect, createMemo, on, onMount } from 'solid-js'
+import { SD_SAMPLER } from '../../../../common/image'
import Divider from '../../../shared/Divider'
import RangeInput from '../../../shared/RangeInput'
import Select from '../../../shared/Select'
@@ -24,42 +9,47 @@ import { IMAGE_SUMMARY_PROMPT } from '/common/image'
import { Toggle } from '/web/shared/Toggle'
import { SolidCard } from '/web/shared/Card'
import Tabs, { useTabs } from '/web/shared/Tabs'
-import { getStrictForm } from '/web/shared/util'
import Button from '/web/shared/Button'
import { Save, X } from 'lucide-solid'
import { RootModal } from '/web/shared/Modal'
import { ImageSettings } from '/common/types/image-schema'
import { isChatPage } from '/web/shared/hooks'
-
-const imageForm = {
- imageType: ['horde', 'sd', 'novel', 'agnai'],
- imageSteps: 'number',
- imageClipSkip: 'number',
- imageCfg: 'number',
- imageWidth: 'number',
- imageHeight: 'number',
- imagePrefix: 'string?',
- imageSuffix: 'string?',
- imageNegative: 'string?',
- summariseChat: 'boolean?',
- summaryPrompt: 'string?',
-
- novelImageModel: 'string',
- novelSampler: 'string',
-
- hordeSampler: 'string',
- hordeImageModel: 'string?',
-
- sdUrl: 'string',
- sdSampler: 'string',
-
- agnaiModel: 'string?',
- agnaiSampler: 'string?',
-} as const
+import { createStore } from 'solid-js/store'
+import { AgnaiSettings, HordeSettings, NovelSettings, SDSettings } from './ServiceSettings'
+
+const init: ImageSettings = {
+ cfg: 7,
+ height: 1216,
+ width: 768,
+ steps: 28,
+ clipSkip: 2,
+ negative: '',
+ prefix: '',
+ suffix: 'full body shot, studio lighting',
+ summariseChat: true,
+ summaryPrompt: '',
+ template: '',
+ type: 'horde',
+ agnai: {
+ model: '',
+ sampler: SD_SAMPLER['Euler a'],
+ },
+ horde: {
+ sampler: SD_SAMPLER['Euler a'],
+ model: '',
+ },
+ sd: {
+ sampler: SD_SAMPLER['Euler a'],
+ url: '',
+ },
+ novel: {
+ model: '',
+ sampler: SD_SAMPLER['Euler a'],
+ },
+}
export const ImageSettingsModal = () => {
- let formRef: any
- const state = userStore()
+ const user = userStore()
const settings = settingStore()
const entity = chatStore((s) => ({
@@ -67,42 +57,32 @@ export const ImageSettingsModal = () => {
char: s.active?.char,
}))
+ const [store, setStore] = createStore(init)
+
const isChat = isChatPage(true)
- const [type, setType] = createSignal(state.user?.images?.type || 'horde')
- onMount(() => {
- settingStore.getServerConfig()
- })
+ onMount(() => settingStore.getServerConfig())
const tabs = createMemo(() => {
const tabs = ['App']
-
if (isChat()) {
- if (entity.chat) {
- tabs.push('Chat')
- }
-
- if (entity.char) {
- tabs.push('Character')
- }
+ if (entity.chat) tabs.push('Chat')
+ if (entity.char) tabs.push('Character')
}
-
return tabs
})
const tab = useTabs(
tabs(),
- isChat()
- ? entity.chat?.imageSource === 'chat'
- ? 1 //
- : !entity.chat?.imageSource || entity.chat?.imageSource === 'settings'
- ? 0
- : 2
+ isChat() && entity.chat?.imageSource === 'chat'
+ ? 1
+ : entity.chat?.imageSource?.includes('character')
+ ? 2
: 0
)
const canUseImages = createMemo(() => {
- const access = state.sub?.tier.imagesAccess || state.user?.admin
+ const access = user.sub?.tier.imagesAccess || user.user?.admin
return (
settings.config.serverConfig?.imagesEnabled &&
access &&
@@ -112,9 +92,9 @@ export const ImageSettingsModal = () => {
const agnaiModel = createMemo(() => {
if (!canUseImages()) return
- if (type() !== 'agnai') return
+ if (store.type !== 'agnai') return
- const id = state.user?.images?.agnai?.model
+ const id = user.user?.images?.agnai?.model
return settings.config.serverConfig?.imagesModels?.find((m) => m.name === id)
})
@@ -137,7 +117,7 @@ export const ImageSettingsModal = () => {
() => cfg(),
(cfg) => {
if (!cfg) return
- setType(cfg.type)
+ setStore({ ...init, ...cfg })
}
)
)
@@ -145,7 +125,7 @@ export const ImageSettingsModal = () => {
const cfg = createMemo(() => {
switch (tab.current()) {
case 'App':
- return state.user?.images
+ return user.user?.images
case 'Chat':
return entity.chat?.imageSettings
@@ -154,65 +134,12 @@ export const ImageSettingsModal = () => {
return entity.char?.imageSettings
default:
- return state.user?.images
+ return user.user?.images
}
})
const subclass = 'flex flex-col gap-4'
- const save = async () => {
- const body = getStrictForm(formRef, imageForm)
- const providers = {
- horde: {
- sampler: body.hordeSampler,
- model: body.hordeImageModel || '',
- },
- novel: {
- model: body.novelImageModel,
- sampler: body.novelSampler,
- },
- sd: {
- sampler: body.sdSampler,
- url: body.sdUrl,
- },
- agnai: { model: body.agnaiModel || '', sampler: body.agnaiSampler || '' },
- }
- const payload = {
- type: body.imageType,
- cfg: body.imageCfg,
- clipSkip: body.imageClipSkip,
- height: body.imageHeight,
- width: body.imageWidth,
- steps: body.imageSteps,
- negative: body.imageNegative,
- prefix: body.imagePrefix,
- suffix: body.imageSuffix,
- summariseChat: body.summariseChat,
- summaryPrompt: body.summaryPrompt,
- ...providers,
- }
-
- switch (tab.current()) {
- case 'App': {
- await userStore.updatePartialConfig({ images: { ...payload, ...providers } })
- return
- }
-
- case 'Chat': {
- chatStore.editChat(entity.chat?._id!, { imageSettings: payload }, undefined)
- return
- }
-
- case 'Character': {
- characterStore.editPartialCharacter(entity.char?._id!, { imageSettings: payload })
- return
- }
-
- default:
- return state.user?.images
- }
- }
-
return (
{
- |