Skip to content

Commit

Permalink
fix(gui): disable img2img tab for now, consistent quotes in jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 6, 2023
1 parent c6662d1 commit de48450
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
with a remote web interface.
Expand Down Expand Up @@ -30,7 +30,7 @@ Based on guides by:

## Contents

- [ONNX Web UI](#onnx-web-ui)
- [ONNX Web](#onnx-web)
- [Features](#features)
- [Contents](#contents)
- [Setup](#setup)
Expand Down
12 changes: 6 additions & 6 deletions gui/src/components/ImageControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export function ImageControl(props: ImageControlProps) {
const { params } = props;

return <Stack spacing={2}>
<Stack direction="row" spacing={4}>
<Stack direction='row' spacing={4}>
<NumericField
label="CFG"
label='CFG'
min={0}
max={30}
step={1}
Expand All @@ -37,7 +37,7 @@ export function ImageControl(props: ImageControlProps) {
}}
/>
<NumericField
label="Steps"
label='Steps'
min={1}
max={150}
step={1}
Expand All @@ -52,9 +52,9 @@ export function ImageControl(props: ImageControlProps) {
}}
/>
</Stack>
<Stack direction="row" spacing={4}>
<Stack direction='row' spacing={4}>
<NumericField
label="Width"
label='Width'
min={8}
max={512}
step={8}
Expand All @@ -69,7 +69,7 @@ export function ImageControl(props: ImageControlProps) {
}}
/>
<NumericField
label="Height"
label='Height'
min={8}
max={512}
step={8}
Expand Down
4 changes: 2 additions & 2 deletions gui/src/components/NumericField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export function NumericField(props: ImageControlProps) {
const { label, min, max, step, value } = props;
return <TextField
label={label}
variant="outlined"
type="number"
variant='outlined'
type='number'
inputProps={{ min, max, step }}
value={value}
onChange={(event) => {
Expand Down
18 changes: 11 additions & 7 deletions gui/src/components/OnnxWeb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface OnnxWebProps {
export function OnnxWeb(props: OnnxWebProps) {
const { client, config } = props;

const [tab, setTab] = useState('1');
const [tab, setTab] = useState('txt2img');
const [model, setModel] = useState(config.default.model);
const [platform, setPlatform] = useState(config.default.platform);

Expand Down Expand Up @@ -67,20 +67,24 @@ export function OnnxWeb(props: OnnxWebProps) {
<TabList onChange={(_e, idx) => {
setTab(idx);
}}>
<Tab label="txt2img" value="1" />
<Tab label="img2img" value="2" />
<Tab label="settings" value="3" />
<Tab label='txt2img' value='txt2img' />
<Tab label='img2img' value='img2img' disabled />
<Tab label='settings' value='settings' />
</TabList>
</Box>
<TabPanel value="1">
<TabPanel value='txt2img'>
<Txt2Img client={client} config={config} model={model} platform={platform} />
</TabPanel>
<TabPanel value="2">
<TabPanel value='img2img'>
<Box>
img2img using {model}
</Box>
</TabPanel>
<TabPanel value="3">settings for onnx-web</TabPanel>
<TabPanel value='settings'>
<Box>
settings for onnx-web
</Box>
</TabPanel>
</TabContext>
</Container>
</div>
Expand Down
2 changes: 1 addition & 1 deletion gui/src/components/Txt2Img.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function Txt2Img(props: Txt2ImgProps) {
<ImageControl params={params} onChange={(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);
}} />
<Button onClick={() => generate.mutate()}>Generate</Button>
Expand Down

0 comments on commit de48450

Please sign in to comment.