mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-01-12 17:28:56 +01:00
wokring checkmark, cleaner time adn translation
This commit is contained in:
parent
de2977284c
commit
96ad8c823a
@ -41,6 +41,7 @@
|
|||||||
"seed": "Seed:",
|
"seed": "Seed:",
|
||||||
"amount-of-img": "Amount of images to make:",
|
"amount-of-img": "Amount of images to make:",
|
||||||
"how-many": "How many at once:",
|
"how-many": "How many at once:",
|
||||||
|
"stream-img": "Stream images (this will slow down image generation):",
|
||||||
"width": "Width:",
|
"width": "Width:",
|
||||||
"height": "Height:",
|
"height": "Height:",
|
||||||
"sampler": "Sampler:",
|
"sampler": "Sampler:",
|
||||||
|
@ -28,7 +28,10 @@ export default function WorkflowSettings() {
|
|||||||
|
|
||||||
const setRequestOption = useImageCreate((state) => state.setRequestOptions);
|
const setRequestOption = useImageCreate((state) => state.setRequestOptions);
|
||||||
const setParallelCount = useImageCreate((state) => state.setParallelCount);
|
const setParallelCount = useImageCreate((state) => state.setParallelCount);
|
||||||
|
const shouldStreamImages = useImageCreate((state) => state.getValueForRequestKey("stream_image_progress"));
|
||||||
const toggleUseAutoSave = useImageCreate((state) => state.toggleUseAutoSave);
|
const toggleUseAutoSave = useImageCreate((state) => state.toggleUseAutoSave);
|
||||||
|
|
||||||
|
|
||||||
const toggleSoundEnabled = useImageCreate(
|
const toggleSoundEnabled = useImageCreate(
|
||||||
(state) => state.toggleSoundEnabled
|
(state) => state.toggleSoundEnabled
|
||||||
);
|
);
|
||||||
@ -69,6 +72,20 @@ export default function WorkflowSettings() {
|
|||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className={SettingItem}>
|
||||||
|
<label>
|
||||||
|
{t("settings.stream-img")}
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={shouldStreamImages}
|
||||||
|
onChange={(e) =>
|
||||||
|
setRequestOption("stream_image_progress", e.target.checked)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className={SettingItem}>
|
<div className={SettingItem}>
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
|
@ -129,16 +129,13 @@ export default function MakeButton() {
|
|||||||
setStartTime();
|
setStartTime();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log('step else', step);
|
|
||||||
setNowTime();
|
setNowTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('progess step of total', step, total_steps);
|
|
||||||
if (void 0 !== outputs) {
|
if (void 0 !== outputs) {
|
||||||
outputs.forEach((output: any) => {
|
outputs.forEach((output: any) => {
|
||||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||||
const timePath = `${output.path}?t=${new Date().getTime()}`
|
const timePath = `${output.path}?t=${new Date().getTime()}`
|
||||||
console.log('progress path', timePath);
|
|
||||||
addProgressImage(timePath);
|
addProgressImage(timePath);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -166,14 +163,14 @@ export default function MakeButton() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const startStream = async (id: string, req: ImageRequest) => {
|
const startStream = async (id: string, req: ImageRequest) => {
|
||||||
const streamReq = {
|
// const streamReq = {
|
||||||
...req,
|
// ...req,
|
||||||
stream_image_progress: true,
|
// stream_image_progress: true,
|
||||||
};
|
// };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
resetForFetching();
|
resetForFetching();
|
||||||
const res = await doMakeImage(streamReq);
|
const res = await doMakeImage(req);
|
||||||
const reader = res.body?.getReader();
|
const reader = res.body?.getReader();
|
||||||
|
|
||||||
if (void 0 !== reader) {
|
if (void 0 !== reader) {
|
||||||
|
@ -27,12 +27,6 @@ const LoadingDisplay = () => {
|
|||||||
const [timeRemaining, setTimeRemaining] = useState(0);
|
const [timeRemaining, setTimeRemaining] = useState(0);
|
||||||
|
|
||||||
const [percent, setPercent] = useState(0);
|
const [percent, setPercent] = useState(0);
|
||||||
console.log("progressImages", progressImages);
|
|
||||||
|
|
||||||
|
|
||||||
// stepsRemaining = totalSteps - overallStepCount
|
|
||||||
// stepsRemaining = (stepsRemaining < 0 ? 0 : stepsRemaining)
|
|
||||||
// timeRemaining = (timeTaken === -1 ? '' : stepsRemaining * timeTaken) // ms
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -49,7 +43,8 @@ const LoadingDisplay = () => {
|
|||||||
const timePerStep = step == 0 ? 0 : timeTaken / step;
|
const timePerStep = step == 0 ? 0 : timeTaken / step;
|
||||||
const totalTime = timePerStep * totalSteps;
|
const totalTime = timePerStep * totalSteps;
|
||||||
const timeRemaining = (totalTime - timeTaken) / 1000;
|
const timeRemaining = (totalTime - timeTaken) / 1000;
|
||||||
setTimeRemaining(timeRemaining);
|
// @ts-expect-error
|
||||||
|
setTimeRemaining(timeRemaining.toPrecision(3));
|
||||||
|
|
||||||
}, [step, totalSteps, startTime, timeNow, setTimeRemaining]);
|
}, [step, totalSteps, startTime, timeNow, setTimeRemaining]);
|
||||||
|
|
||||||
@ -104,8 +99,6 @@ const ImageDisplay = ({ info, data }: CompletedImagesType) => {
|
|||||||
return fileName;
|
return fileName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const setRequestOption = useImageCreate((state) => state.setRequestOptions);
|
const setRequestOption = useImageCreate((state) => state.setRequestOptions);
|
||||||
|
|
||||||
const _handleSave = () => {
|
const _handleSave = () => {
|
||||||
|
@ -52,7 +52,6 @@ export const useImageQueue = create<ImageQueueState>((set, get) => ({
|
|||||||
set(
|
set(
|
||||||
produce((state) => {
|
produce((state) => {
|
||||||
const image = state.images.shift();
|
const image = state.images.shift();
|
||||||
console.log("image", image);
|
|
||||||
if (void 0 !== image) {
|
if (void 0 !== image) {
|
||||||
state.completedImageIds.push(image.id);
|
state.completedImageIds.push(image.id);
|
||||||
}
|
}
|
||||||
|
30
ui/frontend/dist/index.js
vendored
30
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