forked from extern/easydiffusion
clean and pretty
This commit is contained in:
parent
82f8c31b81
commit
1ac8eba1b8
@ -7,7 +7,7 @@ import { darkTheme, lightTheme } from "./styles/theme/index.css.ts";
|
|||||||
import "./Translation/config";
|
import "./Translation/config";
|
||||||
const location = new ReactLocation();
|
const location = new ReactLocation();
|
||||||
|
|
||||||
function App () {
|
function App() {
|
||||||
// just check for the theme one 1 time
|
// just check for the theme one 1 time
|
||||||
|
|
||||||
// var { matches } = window.matchMedia('(prefers-color-scheme: dark)')
|
// var { matches } = window.matchMedia('(prefers-color-scheme: dark)')
|
||||||
|
@ -59,7 +59,6 @@ export const toggleBetaConfig = async (branch: string) => {
|
|||||||
|
|
||||||
export const MakeImageKey = "MakeImage";
|
export const MakeImageKey = "MakeImage";
|
||||||
export const doMakeImage = async (reqBody: ImageRequest) => {
|
export const doMakeImage = async (reqBody: ImageRequest) => {
|
||||||
|
|
||||||
const res = await fetch(`${API_URL}/image`, {
|
const res = await fetch(`${API_URL}/image`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -5,7 +5,7 @@ interface ModifierTagProps {
|
|||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ModifierTag ({ name }: ModifierTagProps) {
|
export default function ModifierTag({ name }: ModifierTagProps) {
|
||||||
const hasTag = useImageCreate((state) => state.hasTag(name))
|
const hasTag = useImageCreate((state) => state.hasTag(name))
|
||||||
? "selected"
|
? "selected"
|
||||||
: "";
|
: "";
|
||||||
|
@ -16,7 +16,7 @@ interface DrawImageProps {
|
|||||||
isErasing: boolean;
|
isErasing: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DrawImage ({
|
export default function DrawImage({
|
||||||
imageData,
|
imageData,
|
||||||
brushSize,
|
brushSize,
|
||||||
brushShape,
|
brushShape,
|
||||||
|
@ -14,7 +14,7 @@ interface GeneretaedImageProps {
|
|||||||
// children: never[];
|
// children: never[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function GeneratedImage ({
|
export default function GeneratedImage({
|
||||||
imageData,
|
imageData,
|
||||||
metadata,
|
metadata,
|
||||||
className,
|
className,
|
||||||
|
@ -4,10 +4,9 @@ import { useImageCreate } from "../../../../../stores/imageCreateStore";
|
|||||||
import { useCreateUI } from "../../creationPanelUIStore";
|
import { useCreateUI } from "../../creationPanelUIStore";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
SettingItem // @ts-expect-error
|
SettingItem, // @ts-expect-error
|
||||||
} from "../../../../../styles/shared.css.ts";
|
} from "../../../../../styles/shared.css.ts";
|
||||||
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MenuButton, // @ts-expect-error
|
MenuButton, // @ts-expect-error
|
||||||
} from "../advancedsettings.css.ts";
|
} from "../advancedsettings.css.ts";
|
||||||
|
@ -4,7 +4,7 @@ import { useImageCreate } from "../../../../../stores/imageCreateStore";
|
|||||||
import { useCreateUI } from "../../creationPanelUIStore";
|
import { useCreateUI } from "../../creationPanelUIStore";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
SettingItem // @ts-expect-error
|
SettingItem, // @ts-expect-error
|
||||||
} from "../../../../../styles/shared.css.ts";
|
} from "../../../../../styles/shared.css.ts";
|
||||||
import {
|
import {
|
||||||
MenuButton, // @ts-expect-error
|
MenuButton, // @ts-expect-error
|
||||||
@ -43,7 +43,6 @@ export default function ImprovementSettings() {
|
|||||||
const [isFilteringDisabled, setIsFilteringDisabled] = useState(false);
|
const [isFilteringDisabled, setIsFilteringDisabled] = useState(false);
|
||||||
// should probably be a store selector
|
// should probably be a store selector
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
||||||
// if either are true we arent disabled
|
// if either are true we arent disabled
|
||||||
if (isUsingFaceCorrection || useUpscale) {
|
if (isUsingFaceCorrection || useUpscale) {
|
||||||
setIsFilteringDisabled(false);
|
setIsFilteringDisabled(false);
|
||||||
|
@ -16,7 +16,7 @@ import GpuSettings from "./gpuSettings";
|
|||||||
|
|
||||||
import BetaMode from "../../../molecules/betaMode";
|
import BetaMode from "../../../molecules/betaMode";
|
||||||
|
|
||||||
function SettingsList () {
|
function SettingsList() {
|
||||||
return (
|
return (
|
||||||
<ul className={AdvancedSettingsList}>
|
<ul className={AdvancedSettingsList}>
|
||||||
<li className={AdvancedSettingGrouping}>
|
<li className={AdvancedSettingGrouping}>
|
||||||
@ -39,7 +39,7 @@ function SettingsList () {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function AdvancedSettings () {
|
export default function AdvancedSettings() {
|
||||||
const advancedSettingsIsOpen = useCreateUI(
|
const advancedSettingsIsOpen = useCreateUI(
|
||||||
(state) => state.isOpenAdvancedSettings
|
(state) => state.isOpenAdvancedSettings
|
||||||
);
|
);
|
||||||
|
@ -3,7 +3,7 @@ import { useImageCreate } from "../../../../../stores/imageCreateStore";
|
|||||||
import { useCreateUI } from "../../creationPanelUIStore";
|
import { useCreateUI } from "../../creationPanelUIStore";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
SettingItem // @ts-expect-error
|
SettingItem, // @ts-expect-error
|
||||||
} from "../../../../../styles/shared.css.ts";
|
} from "../../../../../styles/shared.css.ts";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -4,7 +4,7 @@ import { useImageCreate } from "../../../../../stores/imageCreateStore";
|
|||||||
import { useCreateUI } from "../../creationPanelUIStore";
|
import { useCreateUI } from "../../creationPanelUIStore";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
SettingItem // @ts-expect-error
|
SettingItem, // @ts-expect-error
|
||||||
} from "../../../../../styles/shared.css.ts";
|
} from "../../../../../styles/shared.css.ts";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -3,7 +3,7 @@ import React from "react";
|
|||||||
import { useImageCreate } from "../../../../../stores/imageCreateStore";
|
import { useImageCreate } from "../../../../../stores/imageCreateStore";
|
||||||
import ModifierTag from "../../../../atoms/modifierTag";
|
import ModifierTag from "../../../../atoms/modifierTag";
|
||||||
|
|
||||||
export default function ActiveTags () {
|
export default function ActiveTags() {
|
||||||
const selectedtags = useImageCreate((state) => state.selectedTags());
|
const selectedtags = useImageCreate((state) => state.selectedTags());
|
||||||
return (
|
return (
|
||||||
<div className="selected-tags">
|
<div className="selected-tags">
|
||||||
|
@ -10,7 +10,7 @@ import SeedImage from "./seedImage";
|
|||||||
import ActiveTags from "./activeTags";
|
import ActiveTags from "./activeTags";
|
||||||
import MakeButton from "./makeButton";
|
import MakeButton from "./makeButton";
|
||||||
|
|
||||||
export default function BasicCreation () {
|
export default function BasicCreation() {
|
||||||
const promptText = useImageCreate((state) =>
|
const promptText = useImageCreate((state) =>
|
||||||
state.getValueForRequestKey("prompt")
|
state.getValueForRequestKey("prompt")
|
||||||
);
|
);
|
||||||
|
@ -42,4 +42,4 @@ export const ModifierListStyle = style({
|
|||||||
|
|
||||||
globalStyle(`${ModifierListStyle} li`, {
|
globalStyle(`${ModifierListStyle} li`, {
|
||||||
margin: 0,
|
margin: 0,
|
||||||
});
|
});
|
||||||
|
@ -10,9 +10,8 @@ import {
|
|||||||
ImagerModifierGroups,
|
ImagerModifierGroups,
|
||||||
ImageModifierGrouping,
|
ImageModifierGrouping,
|
||||||
MenuButton,
|
MenuButton,
|
||||||
ModifierListStyle
|
ModifierListStyle, //@ts-expect-error
|
||||||
} from //@ts-expect-error
|
} from "./imageModifiers.css.ts";
|
||||||
"./imageModifiers.css.ts";
|
|
||||||
|
|
||||||
import { useImageCreate } from "../../../../stores/imageCreateStore";
|
import { useImageCreate } from "../../../../stores/imageCreateStore";
|
||||||
import { useCreateUI } from "../creationPanelUIStore";
|
import { useCreateUI } from "../creationPanelUIStore";
|
||||||
@ -23,7 +22,7 @@ interface ModifierListProps {
|
|||||||
tags: string[];
|
tags: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
function ModifierList ({ tags }: ModifierListProps) {
|
function ModifierList({ tags }: ModifierListProps) {
|
||||||
return (
|
return (
|
||||||
<ul className={ModifierListStyle}>
|
<ul className={ModifierListStyle}>
|
||||||
{tags.map((tag) => (
|
{tags.map((tag) => (
|
||||||
@ -40,7 +39,7 @@ interface ModifierGroupingProps {
|
|||||||
tags: string[];
|
tags: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
function ModifierGrouping ({ title, tags }: ModifierGroupingProps) {
|
function ModifierGrouping({ title, tags }: ModifierGroupingProps) {
|
||||||
// doing this localy for now, but could move to a store
|
// doing this localy for now, but could move to a store
|
||||||
// and persist if we wanted to
|
// and persist if we wanted to
|
||||||
const [isExpanded, setIsExpanded] = useState(false);
|
const [isExpanded, setIsExpanded] = useState(false);
|
||||||
@ -59,7 +58,7 @@ function ModifierGrouping ({ title, tags }: ModifierGroupingProps) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ImageModifers () {
|
export default function ImageModifers() {
|
||||||
const allModifiers = useImageCreate((state) => state.allModifiers);
|
const allModifiers = useImageCreate((state) => state.allModifiers);
|
||||||
|
|
||||||
const imageModifierIsOpen = useCreateUI((state) => state.isOpenImageModifier);
|
const imageModifierIsOpen = useCreateUI((state) => state.isOpenImageModifier);
|
||||||
|
@ -74,7 +74,6 @@ const app = createGlobalTheme(":root", {
|
|||||||
Body: "1em",
|
Body: "1em",
|
||||||
Caption: ".75em",
|
Caption: ".75em",
|
||||||
Overline: ".5em",
|
Overline: ".5em",
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
colors: colors,
|
colors: colors,
|
||||||
@ -113,7 +112,7 @@ export const darkTheme = createTheme(colors, {
|
|||||||
accentDimmed: "#7d6641", // muted orange
|
accentDimmed: "#7d6641", // muted orange
|
||||||
},
|
},
|
||||||
|
|
||||||
link: '#0066cc', // blue
|
link: "#0066cc", // blue
|
||||||
warning: "#f0ad4e",
|
warning: "#f0ad4e",
|
||||||
error: "#d9534f",
|
error: "#d9534f",
|
||||||
success: "#5cb85c",
|
success: "#5cb85c",
|
||||||
@ -152,7 +151,7 @@ export const lightTheme = createTheme(colors, {
|
|||||||
accentDimmed: "#6B7280",
|
accentDimmed: "#6B7280",
|
||||||
},
|
},
|
||||||
|
|
||||||
link: '#0066cc', // blue
|
link: "#0066cc", // blue
|
||||||
warning: "yellow",
|
warning: "yellow",
|
||||||
error: "red",
|
error: "red",
|
||||||
success: "green",
|
success: "green",
|
||||||
|
@ -18,7 +18,7 @@ import {
|
|||||||
|
|
||||||
import BasicCreation from "./basicCreation";
|
import BasicCreation from "./basicCreation";
|
||||||
|
|
||||||
export default function CreationPanel () {
|
export default function CreationPanel() {
|
||||||
const isInPaintingMode = useImageCreate((state) => state.isInpainting);
|
const isInPaintingMode = useImageCreate((state) => state.isInpainting);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -18,11 +18,9 @@ export const completedImagesList = style({
|
|||||||
width: "100%",
|
width: "100%",
|
||||||
overflow: "auto",
|
overflow: "auto",
|
||||||
paddingLeft: vars.spacing.none,
|
paddingLeft: vars.spacing.none,
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
globalStyle(`${completedImagesMain} li`, {
|
globalStyle(`${completedImagesMain} li`, {
|
||||||
|
|
||||||
position: "relative",
|
position: "relative",
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -34,7 +32,6 @@ globalStyle(`${completedImagesMain} > li:last-of-type`, {
|
|||||||
marginRight: 0,
|
marginRight: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
export const imageContain = style({
|
export const imageContain = style({
|
||||||
width: "206px",
|
width: "206px",
|
||||||
backgroundColor: "black",
|
backgroundColor: "black",
|
||||||
@ -48,8 +45,6 @@ export const imageContain = style({
|
|||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
globalStyle(`${imageContain} img`, {
|
globalStyle(`${imageContain} img`, {
|
||||||
width: "100%",
|
width: "100%",
|
||||||
objectFit: "contain",
|
objectFit: "contain",
|
||||||
@ -62,4 +57,4 @@ export const RemoveButton = style({
|
|||||||
padding: vars.spacing.small,
|
padding: vars.spacing.small,
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
borderRadius: vars.trim.borderRadiusSmall,
|
borderRadius: vars.trim.borderRadiusSmall,
|
||||||
});
|
});
|
||||||
|
@ -16,7 +16,7 @@ interface CurrentDisplayProps {
|
|||||||
removeImages: () => void;
|
removeImages: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function CompletedImages ({
|
export default function CompletedImages({
|
||||||
images,
|
images,
|
||||||
setCurrentDisplay,
|
setCurrentDisplay,
|
||||||
removeImages,
|
removeImages,
|
||||||
@ -30,11 +30,14 @@ export default function CompletedImages ({
|
|||||||
<div className={completedImagesMain}>
|
<div className={completedImagesMain}>
|
||||||
{/* Adjust the dom do we dont do this check twice */}
|
{/* Adjust the dom do we dont do this check twice */}
|
||||||
{images != null && images.length > 0 && (
|
{images != null && images.length > 0 && (
|
||||||
<button className={RemoveButton} onClick={
|
<button
|
||||||
() => {
|
className={RemoveButton}
|
||||||
|
onClick={() => {
|
||||||
removeImages();
|
removeImages();
|
||||||
}
|
}}
|
||||||
}>REMOVE</button>
|
>
|
||||||
|
REMOVE
|
||||||
|
</button>
|
||||||
)}
|
)}
|
||||||
<ul className={completedImagesList}>
|
<ul className={completedImagesList}>
|
||||||
{images != null &&
|
{images != null &&
|
||||||
@ -59,6 +62,5 @@ export default function CompletedImages ({
|
|||||||
})}
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable multiline-ternary */
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import GeneratedImage from "../../../molecules/generatedImage";
|
import GeneratedImage from "../../../molecules/generatedImage";
|
||||||
@ -13,7 +14,10 @@ interface CurrentDisplayProps {
|
|||||||
image: CompletedImagesType | null;
|
image: CompletedImagesType | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function CurrentDisplay({ isLoading, image }: CurrentDisplayProps) {
|
export default function CurrentDisplay({
|
||||||
|
isLoading,
|
||||||
|
image,
|
||||||
|
}: CurrentDisplayProps) {
|
||||||
const { info, data } = image ?? {};
|
const { info, data } = image ?? {};
|
||||||
|
|
||||||
const setRequestOption = useImageCreate((state) => state.setRequestOptions);
|
const setRequestOption = useImageCreate((state) => state.setRequestOptions);
|
||||||
@ -30,7 +34,6 @@ export default function CurrentDisplay({ isLoading, image }: CurrentDisplayProps
|
|||||||
height,
|
height,
|
||||||
} = info! as ImageRequest;
|
} = info! as ImageRequest;
|
||||||
|
|
||||||
|
|
||||||
// Most important information is the prompt
|
// Most important information is the prompt
|
||||||
let underscoreName = prompt.replace(/[^a-zA-Z0-9]/g, "_");
|
let underscoreName = prompt.replace(/[^a-zA-Z0-9]/g, "_");
|
||||||
underscoreName = underscoreName.substring(0, 100);
|
underscoreName = underscoreName.substring(0, 100);
|
||||||
@ -62,12 +65,12 @@ export default function CurrentDisplay({ isLoading, image }: CurrentDisplayProps
|
|||||||
setRequestOption("init_image", data);
|
setRequestOption("init_image", data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="current-display">
|
<div className="current-display">
|
||||||
{isLoading
|
{isLoading ? (
|
||||||
? <h4 className="loading">Loading...</h4>
|
<h4 className="loading">Loading...</h4>
|
||||||
: (image != null && (
|
) : (
|
||||||
|
(image != null && (
|
||||||
<div>
|
<div>
|
||||||
<p> {info?.prompt}</p>
|
<p> {info?.prompt}</p>
|
||||||
<GeneratedImage imageData={data} metadata={info}></GeneratedImage>
|
<GeneratedImage imageData={data} metadata={info}></GeneratedImage>
|
||||||
@ -76,8 +79,8 @@ export default function CurrentDisplay({ isLoading, image }: CurrentDisplayProps
|
|||||||
<button onClick={_handleUseAsInput}>Use as Input</button>
|
<button onClick={_handleUseAsInput}>Use as Input</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)) || <h4 className="no-image">Try Making a new image!</h4>}
|
)) || <h4 className="no-image">Try Making a new image!</h4>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ export interface CompletedImagesType {
|
|||||||
info: ImageRequest;
|
info: ImageRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
const idDelim = '_batch';
|
const idDelim = "_batch";
|
||||||
|
|
||||||
export default function DisplayPanel() {
|
export default function DisplayPanel() {
|
||||||
const dingRef = useRef<HTMLAudioElement>(null);
|
const dingRef = useRef<HTMLAudioElement>(null);
|
||||||
@ -51,14 +51,14 @@ export default function DisplayPanel() {
|
|||||||
[MakeImageKey, id],
|
[MakeImageKey, id],
|
||||||
async () => await doMakeImage(options),
|
async () => await doMakeImage(options),
|
||||||
{
|
{
|
||||||
enabled: isEnabled
|
enabled: isEnabled,
|
||||||
// void 0 !== id,
|
// void 0 !== id,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// update the enabled state when the id changes
|
// update the enabled state when the id changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsEnabled(void 0 !== id)
|
setIsEnabled(void 0 !== id);
|
||||||
}, [id]);
|
}, [id]);
|
||||||
|
|
||||||
// helper for the loading state to be enabled aware
|
// helper for the loading state to be enabled aware
|
||||||
@ -84,7 +84,6 @@ export default function DisplayPanel() {
|
|||||||
}
|
}
|
||||||
}, [status, data, removeFirstInQueue, dingRef, isSoundEnabled]);
|
}, [status, data, removeFirstInQueue, dingRef, isSoundEnabled]);
|
||||||
|
|
||||||
|
|
||||||
/* COMPLETED IMAGES */
|
/* COMPLETED IMAGES */
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const [completedImages, setCompletedImages] = useState<CompletedImagesType[]>(
|
const [completedImages, setCompletedImages] = useState<CompletedImagesType[]>(
|
||||||
@ -140,13 +139,14 @@ export default function DisplayPanel() {
|
|||||||
clearCachedIds();
|
clearCachedIds();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={displayPanel}>
|
<div className={displayPanel}>
|
||||||
<AudioDing ref={dingRef}></AudioDing>
|
<AudioDing ref={dingRef}></AudioDing>
|
||||||
<div className={displayContainer}>
|
<div className={displayContainer}>
|
||||||
<CurrentDisplay isLoading={isLoading} image={currentImage}></CurrentDisplay>
|
<CurrentDisplay
|
||||||
|
isLoading={isLoading}
|
||||||
|
image={currentImage}
|
||||||
|
></CurrentDisplay>
|
||||||
</div>
|
</div>
|
||||||
<div className={previousImages}>
|
<div className={previousImages}>
|
||||||
<CompletedImages
|
<CompletedImages
|
||||||
|
@ -3,7 +3,6 @@ import { style, globalStyle } from "@vanilla-extract/css";
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { vars } from "../../../styles/theme/index.css.ts";
|
import { vars } from "../../../styles/theme/index.css.ts";
|
||||||
|
|
||||||
|
|
||||||
export const FooterDisplayMain = style({
|
export const FooterDisplayMain = style({
|
||||||
color: vars.colors.text.normal,
|
color: vars.colors.text.normal,
|
||||||
fontSize: vars.fonts.sizes.Caption,
|
fontSize: vars.fonts.sizes.Caption,
|
||||||
@ -13,7 +12,8 @@ export const FooterDisplayMain = style({
|
|||||||
// marginBottom: vars.spacing.medium,
|
// marginBottom: vars.spacing.medium,
|
||||||
// TODO move this to the theme
|
// TODO move this to the theme
|
||||||
padding: vars.spacing.small,
|
padding: vars.spacing.small,
|
||||||
boxShadow: "0 4px 8px 0 rgba(0, 0, 0, 0.15), 0 6px 20px 0 rgba(0, 0, 0, 0.15)",
|
boxShadow:
|
||||||
|
"0 4px 8px 0 rgba(0, 0, 0, 0.15), 0 6px 20px 0 rgba(0, 0, 0, 0.15)",
|
||||||
});
|
});
|
||||||
|
|
||||||
export const CoffeeButton = style({
|
export const CoffeeButton = style({
|
||||||
@ -46,7 +46,6 @@ globalStyle(`${FooterDisplayMain} p`, {
|
|||||||
margin: vars.spacing.min,
|
margin: vars.spacing.min,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// .footer-display {
|
// .footer-display {
|
||||||
// color: #ffffff;
|
// color: #ffffff;
|
||||||
// display: flex;
|
// display: flex;
|
||||||
@ -58,4 +57,4 @@ globalStyle(`${FooterDisplayMain} p`, {
|
|||||||
// #coffeeButton {
|
// #coffeeButton {
|
||||||
// height: 23px;
|
// height: 23px;
|
||||||
// transform: translateY(25%);
|
// transform: translateY(25%);
|
||||||
// }
|
// }
|
||||||
|
@ -2,13 +2,12 @@ import React from "react";
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
FooterDisplayMain,
|
FooterDisplayMain,
|
||||||
CoffeeButton
|
CoffeeButton, // @ts-ignore
|
||||||
} from // @ts-ignore
|
} from "./footerDisplay.css.ts";
|
||||||
"./footerDisplay.css.ts";
|
|
||||||
|
|
||||||
import { API_URL } from "../../../api";
|
import { API_URL } from "../../../api";
|
||||||
|
|
||||||
export default function FooterDisplay () {
|
export default function FooterDisplay() {
|
||||||
return (
|
return (
|
||||||
<div className={FooterDisplayMain}>
|
<div className={FooterDisplayMain}>
|
||||||
<p>
|
<p>
|
||||||
|
@ -13,7 +13,7 @@ const startingMessage = "Stable Diffusion is starting...";
|
|||||||
const successMessage = "Stable Diffusion is ready to use!";
|
const successMessage = "Stable Diffusion is ready to use!";
|
||||||
const errorMessage = "Stable Diffusion is not running!";
|
const errorMessage = "Stable Diffusion is not running!";
|
||||||
|
|
||||||
export default function StatusDisplay ({ className }: { className?: string }) {
|
export default function StatusDisplay({ className }: { className?: string }) {
|
||||||
const [statusMessage, setStatusMessage] = useState(startingMessage);
|
const [statusMessage, setStatusMessage] = useState(startingMessage);
|
||||||
const [statusClass, setStatusClass] = useState(StartingStatus);
|
const [statusClass, setStatusClass] = useState(StartingStatus);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default function Beta () {
|
export default function Beta() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1>Beta</h1>
|
<h1>Beta</h1>
|
||||||
|
@ -20,7 +20,7 @@ import CreationPanel from "../../components/organisms/creationPanel";
|
|||||||
import DisplayPanel from "../../components/organisms/displayPanel";
|
import DisplayPanel from "../../components/organisms/displayPanel";
|
||||||
import FooterDisplay from "../../components/organisms/footerDisplay";
|
import FooterDisplay from "../../components/organisms/footerDisplay";
|
||||||
|
|
||||||
function Home ({ className }: { className: any }) {
|
function Home({ className }: { className: any }) {
|
||||||
// Get the original save directory
|
// Get the original save directory
|
||||||
const setRequestOption = useImageCreate((state) => state.setRequestOptions);
|
const setRequestOption = useImageCreate((state) => state.setRequestOptions);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default function Settings ({ className }: { className: any }) {
|
export default function Settings({ className }: { className: any }) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1>Settings</h1>
|
<h1>Settings</h1>
|
||||||
|
@ -17,37 +17,37 @@ export type ImageRequest = {
|
|||||||
num_inference_steps: number;
|
num_inference_steps: number;
|
||||||
guidance_scale: number;
|
guidance_scale: number;
|
||||||
width:
|
width:
|
||||||
| 128
|
| 128
|
||||||
| 192
|
| 192
|
||||||
| 256
|
| 256
|
||||||
| 320
|
| 320
|
||||||
| 384
|
| 384
|
||||||
| 448
|
| 448
|
||||||
| 512
|
| 512
|
||||||
| 576
|
| 576
|
||||||
| 640
|
| 640
|
||||||
| 704
|
| 704
|
||||||
| 768
|
| 768
|
||||||
| 832
|
| 832
|
||||||
| 896
|
| 896
|
||||||
| 960
|
| 960
|
||||||
| 1024;
|
| 1024;
|
||||||
height:
|
height:
|
||||||
| 128
|
| 128
|
||||||
| 192
|
| 192
|
||||||
| 256
|
| 256
|
||||||
| 320
|
| 320
|
||||||
| 384
|
| 384
|
||||||
| 448
|
| 448
|
||||||
| 512
|
| 512
|
||||||
| 576
|
| 576
|
||||||
| 640
|
| 640
|
||||||
| 704
|
| 704
|
||||||
| 768
|
| 768
|
||||||
| 832
|
| 832
|
||||||
| 896
|
| 896
|
||||||
| 960
|
| 960
|
||||||
| 1024;
|
| 1024;
|
||||||
// allow_nsfw: boolean;
|
// allow_nsfw: boolean;
|
||||||
turbo: boolean;
|
turbo: boolean;
|
||||||
use_cpu: boolean;
|
use_cpu: boolean;
|
||||||
@ -235,7 +235,7 @@ export const useImageCreate = create<ImageCreateState>(
|
|||||||
produce((state) => {
|
produce((state) => {
|
||||||
const isSeting =
|
const isSeting =
|
||||||
typeof state.getValueForRequestKey("use_face_correction") ===
|
typeof state.getValueForRequestKey("use_face_correction") ===
|
||||||
"string"
|
"string"
|
||||||
? null
|
? null
|
||||||
: "GFPGANv1.3";
|
: "GFPGANv1.3";
|
||||||
state.requestOptions.use_face_correction = isSeting;
|
state.requestOptions.use_face_correction = isSeting;
|
||||||
|
@ -53,6 +53,5 @@ export const useImageQueue = create<ImageQueueState>((set, get) => ({
|
|||||||
state.completedImageIds = [];
|
state.completedImageIds = [];
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
@ -26,7 +26,7 @@ globalStyle(`*`, {
|
|||||||
|
|
||||||
globalStyle(`button`, {
|
globalStyle(`button`, {
|
||||||
fontSize: vars.fonts.sizes.Body,
|
fontSize: vars.fonts.sizes.Body,
|
||||||
})
|
});
|
||||||
|
|
||||||
/** RESETS */
|
/** RESETS */
|
||||||
globalStyle(`p, h1, h2, h3, h4, h5, h6, ul`, {
|
globalStyle(`p, h1, h2, h3, h4, h5, h6, ul`, {
|
||||||
@ -41,7 +41,6 @@ globalStyle(`h3`, {
|
|||||||
globalStyle(`h4, h5`, {
|
globalStyle(`h4, h5`, {
|
||||||
fontSize: vars.fonts.sizes.SubSubheadline,
|
fontSize: vars.fonts.sizes.SubSubheadline,
|
||||||
fontFamily: vars.fonts.body,
|
fontFamily: vars.fonts.body,
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
globalStyle(`p, label`, {
|
globalStyle(`p, label`, {
|
||||||
@ -54,6 +53,6 @@ globalStyle(`textarea`, {
|
|||||||
padding: 0,
|
padding: 0,
|
||||||
border: "none",
|
border: "none",
|
||||||
fontSize: vars.fonts.sizes.Body,
|
fontSize: vars.fonts.sizes.Body,
|
||||||
fontWeight: 'bold',
|
fontWeight: "bold",
|
||||||
fontFamily: vars.fonts.body,
|
fontFamily: vars.fonts.body,
|
||||||
});
|
});
|
||||||
|
@ -9,11 +9,10 @@ export const PanelBox = style({
|
|||||||
borderRadius: vars.trim.smallBorderRadius,
|
borderRadius: vars.trim.smallBorderRadius,
|
||||||
marginBottom: vars.spacing.medium,
|
marginBottom: vars.spacing.medium,
|
||||||
// TODO move this to the theme
|
// TODO move this to the theme
|
||||||
boxShadow: "0 4px 8px 0 rgba(0, 0, 0, 0.15), 0 6px 20px 0 rgba(0, 0, 0, 0.15)",
|
boxShadow:
|
||||||
|
"0 4px 8px 0 rgba(0, 0, 0, 0.15), 0 6px 20px 0 rgba(0, 0, 0, 0.15)",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
globalStyle(`${PanelBox} .panel-box-toggle-btn`, {
|
globalStyle(`${PanelBox} .panel-box-toggle-btn`, {
|
||||||
display: "block",
|
display: "block",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
|
@ -12,7 +12,6 @@ import {
|
|||||||
* Lots of these arent used yet, but once they are defined and useable then they can be set.
|
* Lots of these arent used yet, but once they are defined and useable then they can be set.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
const colors = createThemeContract({
|
const colors = createThemeContract({
|
||||||
brand: null,
|
brand: null,
|
||||||
brandDimmed: null,
|
brandDimmed: null,
|
||||||
@ -55,7 +54,7 @@ const colors = createThemeContract({
|
|||||||
const app = createGlobalTheme(":root", {
|
const app = createGlobalTheme(":root", {
|
||||||
spacing: {
|
spacing: {
|
||||||
none: "0",
|
none: "0",
|
||||||
min: '2px',
|
min: "2px",
|
||||||
small: "5px",
|
small: "5px",
|
||||||
medium: "10px",
|
medium: "10px",
|
||||||
large: "25px",
|
large: "25px",
|
||||||
@ -76,7 +75,6 @@ const app = createGlobalTheme(":root", {
|
|||||||
Plain: "0.8em",
|
Plain: "0.8em",
|
||||||
Caption: ".75em",
|
Caption: ".75em",
|
||||||
Overline: ".5em",
|
Overline: ".5em",
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
colors,
|
colors,
|
||||||
@ -115,7 +113,7 @@ export const darkTheme = createTheme(colors, {
|
|||||||
accentDimmed: "#7d6641", // muted orange
|
accentDimmed: "#7d6641", // muted orange
|
||||||
},
|
},
|
||||||
|
|
||||||
link: '#0066cc', // blue
|
link: "#0066cc", // blue
|
||||||
warning: "#f0ad4e",
|
warning: "#f0ad4e",
|
||||||
error: "#d9534f",
|
error: "#d9534f",
|
||||||
success: "#5cb85c",
|
success: "#5cb85c",
|
||||||
@ -154,7 +152,7 @@ export const lightTheme = createTheme(colors, {
|
|||||||
accentDimmed: "#6B7280",
|
accentDimmed: "#6B7280",
|
||||||
},
|
},
|
||||||
|
|
||||||
link: '#0066cc', // blue
|
link: "#0066cc", // blue
|
||||||
warning: "yellow",
|
warning: "yellow",
|
||||||
error: "red",
|
error: "red",
|
||||||
success: "green",
|
success: "green",
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from "vite";
|
||||||
import eslint from 'vite-plugin-eslint';
|
import eslint from "vite-plugin-eslint";
|
||||||
import react from '@vitejs/plugin-react';
|
import react from "@vitejs/plugin-react";
|
||||||
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
||||||
|
|
||||||
import path from 'path';
|
import path from "path";
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
resolve: {
|
resolve: {
|
||||||
|
26
ui/frontend/dist/index.js
vendored
26
ui/frontend/dist/index.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user