wokring checkmark, cleaner time adn translation

This commit is contained in:
caranicas 2022-09-27 11:02:58 -04:00
parent de2977284c
commit 96ad8c823a
6 changed files with 40 additions and 33 deletions

View File

@ -41,6 +41,7 @@
"seed": "Seed:",
"amount-of-img": "Amount of images to make:",
"how-many": "How many at once:",
"stream-img": "Stream images (this will slow down image generation):",
"width": "Width:",
"height": "Height:",
"sampler": "Sampler:",

View File

@ -28,7 +28,10 @@ export default function WorkflowSettings() {
const setRequestOption = useImageCreate((state) => state.setRequestOptions);
const setParallelCount = useImageCreate((state) => state.setParallelCount);
const shouldStreamImages = useImageCreate((state) => state.getValueForRequestKey("stream_image_progress"));
const toggleUseAutoSave = useImageCreate((state) => state.toggleUseAutoSave);
const toggleSoundEnabled = useImageCreate(
(state) => state.toggleSoundEnabled
);
@ -69,6 +72,20 @@ export default function WorkflowSettings() {
/>
</label>
</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}>
<label>
<input

View File

@ -129,16 +129,13 @@ export default function MakeButton() {
setStartTime();
}
else {
console.log('step else', step);
setNowTime();
}
console.log('progess step of total', step, total_steps);
if (void 0 !== outputs) {
outputs.forEach((output: any) => {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
const timePath = `${output.path}?t=${new Date().getTime()}`
console.log('progress path', timePath);
addProgressImage(timePath);
});
}
@ -166,14 +163,14 @@ export default function MakeButton() {
}
const startStream = async (id: string, req: ImageRequest) => {
const streamReq = {
...req,
stream_image_progress: true,
};
// const streamReq = {
// ...req,
// stream_image_progress: true,
// };
try {
resetForFetching();
const res = await doMakeImage(streamReq);
const res = await doMakeImage(req);
const reader = res.body?.getReader();
if (void 0 !== reader) {

View File

@ -27,12 +27,6 @@ const LoadingDisplay = () => {
const [timeRemaining, setTimeRemaining] = 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(() => {
@ -49,7 +43,8 @@ const LoadingDisplay = () => {
const timePerStep = step == 0 ? 0 : timeTaken / step;
const totalTime = timePerStep * totalSteps;
const timeRemaining = (totalTime - timeTaken) / 1000;
setTimeRemaining(timeRemaining);
// @ts-expect-error
setTimeRemaining(timeRemaining.toPrecision(3));
}, [step, totalSteps, startTime, timeNow, setTimeRemaining]);
@ -104,8 +99,6 @@ const ImageDisplay = ({ info, data }: CompletedImagesType) => {
return fileName;
};
const setRequestOption = useImageCreate((state) => state.setRequestOptions);
const _handleSave = () => {

View File

@ -52,7 +52,6 @@ export const useImageQueue = create<ImageQueueState>((set, get) => ({
set(
produce((state) => {
const image = state.images.shift();
console.log("image", image);
if (void 0 !== image) {
state.completedImageIds.push(image.id);
}

File diff suppressed because one or more lines are too long