fix(gui): disable img2img tab for now, consistent quotes in jsx
This commit is contained in:
parent
c6662d155d
commit
de48450730
|
@ -1,4 +1,4 @@
|
||||||
# ONNX Web UI
|
# ONNX Web
|
||||||
|
|
||||||
This is a rudimentary web UI for ONNX models, providing a way to run GPU-accelerated models on Windows and even AMD
|
This is a rudimentary web UI for ONNX models, providing a way to run GPU-accelerated models on Windows and even AMD
|
||||||
with a remote web interface.
|
with a remote web interface.
|
||||||
|
@ -30,7 +30,7 @@ Based on guides by:
|
||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
- [ONNX Web UI](#onnx-web-ui)
|
- [ONNX Web](#onnx-web)
|
||||||
- [Features](#features)
|
- [Features](#features)
|
||||||
- [Contents](#contents)
|
- [Contents](#contents)
|
||||||
- [Setup](#setup)
|
- [Setup](#setup)
|
||||||
|
|
|
@ -20,9 +20,9 @@ export function ImageControl(props: ImageControlProps) {
|
||||||
const { params } = props;
|
const { params } = props;
|
||||||
|
|
||||||
return <Stack spacing={2}>
|
return <Stack spacing={2}>
|
||||||
<Stack direction="row" spacing={4}>
|
<Stack direction='row' spacing={4}>
|
||||||
<NumericField
|
<NumericField
|
||||||
label="CFG"
|
label='CFG'
|
||||||
min={0}
|
min={0}
|
||||||
max={30}
|
max={30}
|
||||||
step={1}
|
step={1}
|
||||||
|
@ -37,7 +37,7 @@ export function ImageControl(props: ImageControlProps) {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<NumericField
|
<NumericField
|
||||||
label="Steps"
|
label='Steps'
|
||||||
min={1}
|
min={1}
|
||||||
max={150}
|
max={150}
|
||||||
step={1}
|
step={1}
|
||||||
|
@ -52,9 +52,9 @@ export function ImageControl(props: ImageControlProps) {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction="row" spacing={4}>
|
<Stack direction='row' spacing={4}>
|
||||||
<NumericField
|
<NumericField
|
||||||
label="Width"
|
label='Width'
|
||||||
min={8}
|
min={8}
|
||||||
max={512}
|
max={512}
|
||||||
step={8}
|
step={8}
|
||||||
|
@ -69,7 +69,7 @@ export function ImageControl(props: ImageControlProps) {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<NumericField
|
<NumericField
|
||||||
label="Height"
|
label='Height'
|
||||||
min={8}
|
min={8}
|
||||||
max={512}
|
max={512}
|
||||||
step={8}
|
step={8}
|
||||||
|
|
|
@ -16,8 +16,8 @@ export function NumericField(props: ImageControlProps) {
|
||||||
const { label, min, max, step, value } = props;
|
const { label, min, max, step, value } = props;
|
||||||
return <TextField
|
return <TextField
|
||||||
label={label}
|
label={label}
|
||||||
variant="outlined"
|
variant='outlined'
|
||||||
type="number"
|
type='number'
|
||||||
inputProps={{ min, max, step }}
|
inputProps={{ min, max, step }}
|
||||||
value={value}
|
value={value}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
|
|
|
@ -19,7 +19,7 @@ export interface OnnxWebProps {
|
||||||
export function OnnxWeb(props: OnnxWebProps) {
|
export function OnnxWeb(props: OnnxWebProps) {
|
||||||
const { client, config } = props;
|
const { client, config } = props;
|
||||||
|
|
||||||
const [tab, setTab] = useState('1');
|
const [tab, setTab] = useState('txt2img');
|
||||||
const [model, setModel] = useState(config.default.model);
|
const [model, setModel] = useState(config.default.model);
|
||||||
const [platform, setPlatform] = useState(config.default.platform);
|
const [platform, setPlatform] = useState(config.default.platform);
|
||||||
|
|
||||||
|
@ -67,20 +67,24 @@ export function OnnxWeb(props: OnnxWebProps) {
|
||||||
<TabList onChange={(_e, idx) => {
|
<TabList onChange={(_e, idx) => {
|
||||||
setTab(idx);
|
setTab(idx);
|
||||||
}}>
|
}}>
|
||||||
<Tab label="txt2img" value="1" />
|
<Tab label='txt2img' value='txt2img' />
|
||||||
<Tab label="img2img" value="2" />
|
<Tab label='img2img' value='img2img' disabled />
|
||||||
<Tab label="settings" value="3" />
|
<Tab label='settings' value='settings' />
|
||||||
</TabList>
|
</TabList>
|
||||||
</Box>
|
</Box>
|
||||||
<TabPanel value="1">
|
<TabPanel value='txt2img'>
|
||||||
<Txt2Img client={client} config={config} model={model} platform={platform} />
|
<Txt2Img client={client} config={config} model={model} platform={platform} />
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel value="2">
|
<TabPanel value='img2img'>
|
||||||
<Box>
|
<Box>
|
||||||
img2img using {model}
|
img2img using {model}
|
||||||
</Box>
|
</Box>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel value="3">settings for onnx-web</TabPanel>
|
<TabPanel value='settings'>
|
||||||
|
<Box>
|
||||||
|
settings for onnx-web
|
||||||
|
</Box>
|
||||||
|
</TabPanel>
|
||||||
</TabContext>
|
</TabContext>
|
||||||
</Container>
|
</Container>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -65,7 +65,7 @@ export function Txt2Img(props: Txt2ImgProps) {
|
||||||
<ImageControl params={params} onChange={(newParams) => {
|
<ImageControl params={params} onChange={(newParams) => {
|
||||||
setParams(newParams);
|
setParams(newParams);
|
||||||
}} />
|
}} />
|
||||||
<TextField label="Prompt" variant="outlined" value={prompt} onChange={(event) => {
|
<TextField label='Prompt' variant='outlined' value={prompt} onChange={(event) => {
|
||||||
setPrompt(event.target.value);
|
setPrompt(event.target.value);
|
||||||
}} />
|
}} />
|
||||||
<Button onClick={() => generate.mutate()}>Generate</Button>
|
<Button onClick={() => generate.mutate()}>Generate</Button>
|
||||||
|
|
Loading…
Reference in New Issue