Spaces:
Sleeping
Sleeping
Julian Bilcke
commited on
Commit
·
726926f
1
Parent(s):
72947d4
fixing a flaw in the logic
Browse files
src/app/interface/panel/index.tsx
CHANGED
|
@@ -78,36 +78,41 @@ export function Panel({
|
|
| 78 |
setTimeout(() => {
|
| 79 |
startTransition(async () => {
|
| 80 |
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
}, [prompt, width, height])
|
| 112 |
|
| 113 |
|
|
|
|
| 78 |
setTimeout(() => {
|
| 79 |
startTransition(async () => {
|
| 80 |
|
| 81 |
+
// console.log(`Loading panel ${panel}..`)
|
| 82 |
+
|
| 83 |
+
let newRendered: RenderedScene
|
| 84 |
+
try {
|
| 85 |
+
newRendered = await newRender({ prompt, width, height })
|
| 86 |
+
} catch (err) {
|
| 87 |
+
// "Failed to load the panel! Don't worry, we are retrying..")
|
| 88 |
+
newRendered = await newRender({ prompt, width, height })
|
| 89 |
+
}
|
| 90 |
|
| 91 |
+
if (newRendered) {
|
| 92 |
+
// console.log("newRendered:", newRendered)
|
| 93 |
+
setRendered(panelId, newRendered)
|
| 94 |
+
|
| 95 |
+
if (newRendered.status === "completed") {
|
| 96 |
+
setGeneratingImages(panelId, false)
|
| 97 |
+
addToUpscaleQueue(panelId, newRendered)
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
// but we are still loading!
|
| 101 |
+
} else {
|
| 102 |
+
setRendered(panelId, {
|
| 103 |
+
renderId: "",
|
| 104 |
+
status: "pending",
|
| 105 |
+
assetUrl: "",
|
| 106 |
+
alt: "",
|
| 107 |
+
maskUrl: "",
|
| 108 |
+
error: "",
|
| 109 |
+
segments: []
|
| 110 |
+
})
|
| 111 |
+
setGeneratingImages(panelId, false)
|
| 112 |
+
return
|
| 113 |
+
}
|
| 114 |
+
})
|
| 115 |
+
}, enableRateLimiter ? 2000 * panel : 0)
|
| 116 |
}, [prompt, width, height])
|
| 117 |
|
| 118 |
|
src/app/interface/top-menu/index.tsx
CHANGED
|
@@ -50,7 +50,7 @@ export function TopMenu() {
|
|
| 50 |
const isGeneratingStory = useStore(state => state.isGeneratingStory)
|
| 51 |
const atLeastOnePanelIsBusy = useStore(state => state.atLeastOnePanelIsBusy)
|
| 52 |
const isBusy = isGeneratingStory || atLeastOnePanelIsBusy
|
| 53 |
-
|
| 54 |
const searchParams = useSearchParams()
|
| 55 |
|
| 56 |
const requestedPreset = (searchParams.get('preset') as PresetName) || defaultPreset
|
|
|
|
| 50 |
const isGeneratingStory = useStore(state => state.isGeneratingStory)
|
| 51 |
const atLeastOnePanelIsBusy = useStore(state => state.atLeastOnePanelIsBusy)
|
| 52 |
const isBusy = isGeneratingStory || atLeastOnePanelIsBusy
|
| 53 |
+
|
| 54 |
const searchParams = useSearchParams()
|
| 55 |
|
| 56 |
const requestedPreset = (searchParams.get('preset') as PresetName) || defaultPreset
|