Commit
•
a79c634
1
Parent(s):
d71abf1
fixed a big bug
Browse files- src/app/interface/panel/index.tsx +3 -1
- src/app/main.tsx +9 -2
src/app/interface/panel/index.tsx
CHANGED
@@ -126,13 +126,15 @@ export function Panel({
|
|
126 |
|
127 |
useEffect(() => {
|
128 |
console.log("starting timeout")
|
|
|
|
|
129 |
// normally it should reply in < 1sec, but we could also use an interval
|
130 |
timeoutRef.current = setTimeout(checkStatus, delay)
|
131 |
|
132 |
return () => {
|
133 |
clearTimeout(timeoutRef.current)
|
134 |
}
|
135 |
-
}, [])
|
136 |
|
137 |
/*
|
138 |
doing the captionning from the browser is expensive
|
|
|
126 |
|
127 |
useEffect(() => {
|
128 |
console.log("starting timeout")
|
129 |
+
clearTimeout(timeoutRef.current)
|
130 |
+
|
131 |
// normally it should reply in < 1sec, but we could also use an interval
|
132 |
timeoutRef.current = setTimeout(checkStatus, delay)
|
133 |
|
134 |
return () => {
|
135 |
clearTimeout(timeoutRef.current)
|
136 |
}
|
137 |
+
}, [prompt, width, height])
|
138 |
|
139 |
/*
|
140 |
doing the captionning from the browser is expensive
|
src/app/main.tsx
CHANGED
@@ -59,10 +59,17 @@ export default function Main() {
|
|
59 |
|
60 |
// TODO call the LLM here!
|
61 |
const panelPrompt = preset.imagePrompt(prompt).join(", ")
|
|
|
62 |
|
63 |
// what we want is for it to invent a small "story"
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
const LayoutElement = (layouts as any)[layout]
|
68 |
|
|
|
59 |
|
60 |
// TODO call the LLM here!
|
61 |
const panelPrompt = preset.imagePrompt(prompt).join(", ")
|
62 |
+
console.log("panelPrompt:", panelPrompt)
|
63 |
|
64 |
// what we want is for it to invent a small "story"
|
65 |
+
// we are going to use a LLM for this, but until then let's do this:
|
66 |
+
setPanels([
|
67 |
+
`introduction scene, ${panelPrompt}`,
|
68 |
+
panelPrompt,
|
69 |
+
panelPrompt,
|
70 |
+
`final scene, ${panelPrompt}`,
|
71 |
+
])
|
72 |
+
}, [prompt, preset?.label]) // important: we need to react to preset changes too
|
73 |
|
74 |
const LayoutElement = (layouts as any)[layout]
|
75 |
|