mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
* Implements rudimentary api * Fixes blocking in API * Adds UI to monorepo > src/frontend/ * Updates frontend/README * Reverts conda env name to `ldm` * Fixes environment yamls * CORS config for testing * Fixes LogViewer position * API WID * Adds actions to image viewer * Increases vite chunkSizeWarningLimit to 1500 * Implements init image * Implements state persistence in localStorage * Improve progress data handling * Final build * Fixes mimetypes error on windows * Adds error logging * Fixes bugged img2img strength component * Adds sourcemaps to dev build * Fixes missing key * Changes connection status indicator to text * Adds ability to serve other hosts than localhost * Adding Flask API server * Removes source maps from config * Fixes prop transfer * Add missing packages and add CORS support * Adding API doc * Remove defaults from openapi doc * Adds basic error handling for server config query * Mostly working socket.io implementation. * Fixes bug preventing mask upload * Fixes bug with sampler name not written to metadata * UI Overhaul, numerous fixes Co-authored-by: Kyle Schouviller <kyle0654@hotmail.com> Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
67 lines
1.9 KiB
TypeScript
67 lines
1.9 KiB
TypeScript
import { Flex } from '@chakra-ui/react';
|
|
|
|
import { RootState } from '../../app/store';
|
|
import { useAppDispatch, useAppSelector } from '../../app/hooks';
|
|
|
|
import { setHeight, setWidth, setSeamless, SDState } from '../sd/sdSlice';
|
|
|
|
import SDSelect from '../../components/SDSelect';
|
|
|
|
import { HEIGHTS, WIDTHS } from '../../app/constants';
|
|
import SDSwitch from '../../components/SDSwitch';
|
|
import { createSelector } from '@reduxjs/toolkit';
|
|
import { isEqual } from 'lodash';
|
|
|
|
const sdSelector = createSelector(
|
|
(state: RootState) => state.sd,
|
|
(sd: SDState) => {
|
|
return {
|
|
height: sd.height,
|
|
width: sd.width,
|
|
seamless: sd.seamless,
|
|
};
|
|
},
|
|
{
|
|
memoizeOptions: {
|
|
resultEqualityCheck: isEqual,
|
|
},
|
|
}
|
|
);
|
|
|
|
const OutputOptions = () => {
|
|
const { height, width, seamless } = useAppSelector(sdSelector);
|
|
|
|
const dispatch = useAppDispatch();
|
|
|
|
return (
|
|
<Flex gap={2} direction={'column'}>
|
|
<Flex gap={2}>
|
|
<SDSelect
|
|
label='Width'
|
|
value={width}
|
|
flexGrow={1}
|
|
onChange={(e) => dispatch(setWidth(Number(e.target.value)))}
|
|
validValues={WIDTHS}
|
|
/>
|
|
<SDSelect
|
|
label='Height'
|
|
value={height}
|
|
flexGrow={1}
|
|
onChange={(e) =>
|
|
dispatch(setHeight(Number(e.target.value)))
|
|
}
|
|
validValues={HEIGHTS}
|
|
/>
|
|
</Flex>
|
|
<SDSwitch
|
|
label='Seamless tiling'
|
|
fontSize={'md'}
|
|
isChecked={seamless}
|
|
onChange={(e) => dispatch(setSeamless(e.target.checked))}
|
|
/>
|
|
</Flex>
|
|
);
|
|
};
|
|
|
|
export default OutputOptions;
|