jbilcke-hf HF staff commited on
Commit
11443d4
β€’
1 Parent(s): f4dea7d

bugfix, improve quality, add layou

Browse files
package-lock.json CHANGED
@@ -24,6 +24,7 @@
24
  "@radix-ui/react-slider": "^1.1.2",
25
  "@radix-ui/react-slot": "^1.0.2",
26
  "@radix-ui/react-switch": "^1.0.3",
 
27
  "@radix-ui/react-tooltip": "^1.0.6",
28
  "@react-pdf/renderer": "^3.1.12",
29
  "@types/node": "20.4.2",
@@ -3263,6 +3264,40 @@
3263
  }
3264
  }
3265
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3266
  "node_modules/@radix-ui/react-tooltip": {
3267
  "version": "1.0.6",
3268
  "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.0.6.tgz",
 
24
  "@radix-ui/react-slider": "^1.1.2",
25
  "@radix-ui/react-slot": "^1.0.2",
26
  "@radix-ui/react-switch": "^1.0.3",
27
+ "@radix-ui/react-toast": "^1.1.4",
28
  "@radix-ui/react-tooltip": "^1.0.6",
29
  "@react-pdf/renderer": "^3.1.12",
30
  "@types/node": "20.4.2",
 
3264
  }
3265
  }
3266
  },
3267
+ "node_modules/@radix-ui/react-toast": {
3268
+ "version": "1.1.4",
3269
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-toast/-/react-toast-1.1.4.tgz",
3270
+ "integrity": "sha512-wf+fc8DOywrpRK3jlPlWVe+ELYGHdKDaaARJZNuUTWyWYq7+ANCFLp4rTjZ/mcGkJJQ/vZ949Zis9xxEpfq9OA==",
3271
+ "dependencies": {
3272
+ "@babel/runtime": "^7.13.10",
3273
+ "@radix-ui/primitive": "1.0.1",
3274
+ "@radix-ui/react-collection": "1.0.3",
3275
+ "@radix-ui/react-compose-refs": "1.0.1",
3276
+ "@radix-ui/react-context": "1.0.1",
3277
+ "@radix-ui/react-dismissable-layer": "1.0.4",
3278
+ "@radix-ui/react-portal": "1.0.3",
3279
+ "@radix-ui/react-presence": "1.0.1",
3280
+ "@radix-ui/react-primitive": "1.0.3",
3281
+ "@radix-ui/react-use-callback-ref": "1.0.1",
3282
+ "@radix-ui/react-use-controllable-state": "1.0.1",
3283
+ "@radix-ui/react-use-layout-effect": "1.0.1",
3284
+ "@radix-ui/react-visually-hidden": "1.0.3"
3285
+ },
3286
+ "peerDependencies": {
3287
+ "@types/react": "*",
3288
+ "@types/react-dom": "*",
3289
+ "react": "^16.8 || ^17.0 || ^18.0",
3290
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
3291
+ },
3292
+ "peerDependenciesMeta": {
3293
+ "@types/react": {
3294
+ "optional": true
3295
+ },
3296
+ "@types/react-dom": {
3297
+ "optional": true
3298
+ }
3299
+ }
3300
+ },
3301
  "node_modules/@radix-ui/react-tooltip": {
3302
  "version": "1.0.6",
3303
  "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.0.6.tgz",
package.json CHANGED
@@ -25,6 +25,7 @@
25
  "@radix-ui/react-slider": "^1.1.2",
26
  "@radix-ui/react-slot": "^1.0.2",
27
  "@radix-ui/react-switch": "^1.0.3",
 
28
  "@radix-ui/react-tooltip": "^1.0.6",
29
  "@react-pdf/renderer": "^3.1.12",
30
  "@types/node": "20.4.2",
 
25
  "@radix-ui/react-slider": "^1.1.2",
26
  "@radix-ui/react-slot": "^1.0.2",
27
  "@radix-ui/react-switch": "^1.0.3",
28
+ "@radix-ui/react-toast": "^1.1.4",
29
  "@radix-ui/react-tooltip": "^1.0.6",
30
  "@react-pdf/renderer": "^3.1.12",
31
  "@types/node": "20.4.2",
src/app/engine/render.ts CHANGED
@@ -50,7 +50,7 @@ export async function newRender({
50
  prompt,
51
  // negativePrompt, unused for now
52
  nbFrames: 1,
53
- nbSteps: 20, // 20 = fast, 30 = better, 50 = best
54
  actionnables: [],
55
  segmentation: "disabled", // one day we will remove this param, to make it automatic
56
  width,
 
50
  prompt,
51
  // negativePrompt, unused for now
52
  nbFrames: 1,
53
+ nbSteps: 25, // 20 = fast, 30 = better, 50 = best
54
  actionnables: [],
55
  segmentation: "disabled", // one day we will remove this param, to make it automatic
56
  width,
src/app/interface/zoom/index.tsx CHANGED
@@ -18,7 +18,7 @@ export function Zoom() {
18
  <VerticalSlider
19
  defaultValue={[zoomLevel]}
20
  min={30}
21
- max={100}
22
  step={1}
23
  onValueChange={value => setZoomLevel(value[0] || 10)}
24
  value={[zoomLevel]}
 
18
  <VerticalSlider
19
  defaultValue={[zoomLevel]}
20
  min={30}
21
+ max={200}
22
  step={1}
23
  onValueChange={value => setZoomLevel(value[0] || 10)}
24
  value={[zoomLevel]}
src/app/layouts/index.tsx CHANGED
@@ -218,7 +218,7 @@ export function Layout6() {
218
  }
219
 
220
  // export const layouts = { Layout1, Layout2, Layout3, Layout4, Layout5, Layout6 }
221
- export const layouts = { Layout1 }
222
 
223
  export type LayoutName = keyof typeof layouts
224
 
 
218
  }
219
 
220
  // export const layouts = { Layout1, Layout2, Layout3, Layout4, Layout5, Layout6 }
221
+ export const layouts = { Layout1, Layout5, Layout6 }
222
 
223
  export type LayoutName = keyof typeof layouts
224
 
src/app/queries/getStory.ts CHANGED
@@ -69,6 +69,15 @@ export const getStory = async ({
69
  return captions.map(caption => caption.split(":").pop()?.trim() || "")
70
  } catch (err) {
71
  console.log(`failed to read LLM response: ${err}`)
72
- return []
 
 
 
 
 
 
 
 
 
73
  }
74
  }
 
69
  return captions.map(caption => caption.split(":").pop()?.trim() || "")
70
  } catch (err) {
71
  console.log(`failed to read LLM response: ${err}`)
72
+
73
+ // in case of failure, it might be because the LLM hallucinated a completely different response,
74
+ // such as markdown. There is no real solution.. but we can try a fallback:
75
+
76
+ const candidateList = (
77
+ tmp.split("*")
78
+ .map(item => item.replaceAll("[", "[").replaceAll("]", "]").trim())
79
+ )
80
+
81
+ return candidateList
82
  }
83
  }
src/app/store/index.ts CHANGED
@@ -30,7 +30,7 @@ export const useStore = create<{
30
  setGeneratingText: (isGeneratingText: boolean) => void
31
  }>((set, get) => ({
32
  prompt: "",
33
- font: "cartoonist",
34
  preset: getPreset("japanese_manga"),
35
  panels: [],
36
  captions: {},
 
30
  setGeneratingText: (isGeneratingText: boolean) => void
31
  }>((set, get) => ({
32
  prompt: "",
33
+ font: "actionman",
34
  preset: getPreset("japanese_manga"),
35
  panels: [],
36
  captions: {},