Merge branch 'development' into vite-relative-paths

This commit is contained in:
Lincoln Stein
2022-10-20 22:12:52 -04:00
committed by GitHub
5 changed files with 713 additions and 6 deletions

690
frontend/dist/assets/index.b06af007.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -72,7 +72,13 @@ export const gallerySlice = createSlice({
},
addImage: (state, action: PayloadAction<InvokeAI.Image>) => {
const newImage = action.payload;
const { uuid, mtime } = newImage;
const { uuid, url, mtime } = newImage;
// Do not add duplicate images
if (state.images.find((i) => i.url === url && i.mtime === mtime)) {
return;
}
state.images.unshift(newImage);
state.currentImageUuid = uuid;
state.intermediateImage = undefined;
@@ -120,8 +126,15 @@ export const gallerySlice = createSlice({
) => {
const { images, areMoreImagesAvailable } = action.payload;
if (images.length > 0) {
// Filter images that already exist in the gallery
const newImages = images.filter(
(newImage) =>
!state.images.find(
(i) => i.url === newImage.url && i.mtime === newImage.mtime
)
);
state.images = state.images
.concat(images)
.concat(newImages)
.sort((a, b) => b.mtime - a.mtime);
if (!state.currentImage) {

View File

@@ -15,7 +15,7 @@ export default function MainCFGScale() {
label="CFG Scale"
step={0.5}
min={1}
max={200}
max={30}
onChange={handleChangeCfgScale}
value={cfgScale}
width={inputWidth}