|
|
@ -8,7 +8,7 @@ import { useRouter } from 'next/router'
|
|
|
|
import { AnimatePresence, motion } from 'framer-motion'
|
|
|
|
import { AnimatePresence, motion } from 'framer-motion'
|
|
|
|
import { HexAlphaColorPicker, HexColorInput } from 'react-colorful'
|
|
|
|
import { HexAlphaColorPicker, HexColorInput } from 'react-colorful'
|
|
|
|
import { MdFileUpload, MdHelpOutline } from 'react-icons/md'
|
|
|
|
import { MdFileUpload, MdHelpOutline } from 'react-icons/md'
|
|
|
|
import { FaQuestion } from 'react-icons/fa'
|
|
|
|
import { FaCoffee, FaQuestion } from 'react-icons/fa'
|
|
|
|
import TextareaAutosize from 'react-textarea-autosize'
|
|
|
|
import TextareaAutosize from 'react-textarea-autosize'
|
|
|
|
import JSZip from 'jszip'
|
|
|
|
import JSZip from 'jszip'
|
|
|
|
import { saveAs } from 'file-saver'
|
|
|
|
import { saveAs } from 'file-saver'
|
|
|
@ -64,7 +64,7 @@ import Checkbox from '../components/controls/checkbox'
|
|
|
|
import { getStorage } from '../data/storage/storage'
|
|
|
|
import { getStorage } from '../data/storage/storage'
|
|
|
|
import { getUserSetting } from '../data/user/settings'
|
|
|
|
import { getUserSetting } from '../data/user/settings'
|
|
|
|
import { useReload } from '../hooks/useReload'
|
|
|
|
import { useReload } from '../hooks/useReload'
|
|
|
|
import { BackendURLTagSearch } from '../globals/constants'
|
|
|
|
import { BackendURLTagSearch, IsIsekai } from '../globals/constants'
|
|
|
|
import Tooltip from '../components/tooltip'
|
|
|
|
import Tooltip from '../components/tooltip'
|
|
|
|
import { WorkerInterface } from '../tokenizer/interface'
|
|
|
|
import { WorkerInterface } from '../tokenizer/interface'
|
|
|
|
import { EncoderType } from '../tokenizer/encoder'
|
|
|
|
import { EncoderType } from '../tokenizer/encoder'
|
|
|
@ -2004,6 +2004,30 @@ function ImageGenContent(): JSX.Element {
|
|
|
|
<HistoryIcon />
|
|
|
|
<HistoryIcon />
|
|
|
|
</OpenHistoryButton>
|
|
|
|
</OpenHistoryButton>
|
|
|
|
<FlexSpaceFull />
|
|
|
|
<FlexSpaceFull />
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
style={{
|
|
|
|
|
|
|
|
display: 'flex',
|
|
|
|
|
|
|
|
gap: '10px',
|
|
|
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
|
|
|
justifyContent: 'space-between'
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{IsIsekai && (
|
|
|
|
|
|
|
|
<ImportImageLink
|
|
|
|
|
|
|
|
href="https://www.isekai.cn"
|
|
|
|
|
|
|
|
target="_blank"
|
|
|
|
|
|
|
|
style={{
|
|
|
|
|
|
|
|
fontSize: '0.875rem',
|
|
|
|
|
|
|
|
opacity: 0.8,
|
|
|
|
|
|
|
|
width: 'max-content',
|
|
|
|
|
|
|
|
padding: '0 0 0 10px',
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<FaCoffee />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
异世界百科
|
|
|
|
|
|
|
|
</ImportImageLink>
|
|
|
|
|
|
|
|
)}
|
|
|
|
<ImportImageLink
|
|
|
|
<ImportImageLink
|
|
|
|
href="//docs.novelai.net"
|
|
|
|
href="//docs.novelai.net"
|
|
|
|
target="_blank"
|
|
|
|
target="_blank"
|
|
|
@ -2016,6 +2040,7 @@ function ImageGenContent(): JSX.Element {
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<FaQuestion />
|
|
|
|
<FaQuestion />
|
|
|
|
</ImportImageLink>
|
|
|
|
</ImportImageLink>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</HideMobileInline>
|
|
|
|
</HideMobileInline>
|
|
|
|
</MainTopperInnerRight>
|
|
|
|
</MainTopperInnerRight>
|
|
|
|
</MainTopper>
|
|
|
|
</MainTopper>
|
|
|
@ -2322,8 +2347,7 @@ function ImageGenContent(): JSX.Element {
|
|
|
|
SD_TOKEN_LIMIT
|
|
|
|
SD_TOKEN_LIMIT
|
|
|
|
}
|
|
|
|
}
|
|
|
|
style={{
|
|
|
|
style={{
|
|
|
|
height: `${
|
|
|
|
height: `${((promptTokens[promptid] ?? 0) /
|
|
|
|
((promptTokens[promptid] ?? 0) /
|
|
|
|
|
|
|
|
SD_TOKEN_LIMIT) *
|
|
|
|
SD_TOKEN_LIMIT) *
|
|
|
|
100
|
|
|
|
100
|
|
|
|
}%`,
|
|
|
|
}%`,
|
|
|
@ -3692,7 +3716,6 @@ function GenerationOptions(props: {
|
|
|
|
maxRows={6}
|
|
|
|
maxRows={6}
|
|
|
|
placeholder="Anything in here is added to the preset selected above."
|
|
|
|
placeholder="Anything in here is added to the preset selected above."
|
|
|
|
value={props.negPrompt ?? ''}
|
|
|
|
value={props.negPrompt ?? ''}
|
|
|
|
warn={props.negPromptTokens > SD_TOKEN_LIMIT}
|
|
|
|
|
|
|
|
onChange={(e) => {
|
|
|
|
onChange={(e) => {
|
|
|
|
props.setNegPrompt((e.target.value || '').replace(/(\n|\r)/g, ''))
|
|
|
|
props.setNegPrompt((e.target.value || '').replace(/(\n|\r)/g, ''))
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|