jbilcke-hf HF staff commited on
Commit
e5255da
β€’
1 Parent(s): 81009f9

big refacto - some poeple may not like it

Browse files
Files changed (2) hide show
  1. src/app/engine/presets.ts +7 -6
  2. src/app/main.tsx +13 -2
src/app/engine/presets.ts CHANGED
@@ -46,12 +46,13 @@ export const presets: Record<string, Preset> = {
46
  imagePrompt: (prompt: string) => [
47
  `grayscale`,
48
  `intricate details`,
49
- `japanese manga about ${prompt}`,
50
- "single panel",
51
- "manga",
52
- "japanese",
53
- "intricate",
54
- "detailed",
 
55
  // "drawing"
56
  ],
57
  negativePrompt: () => [
 
46
  imagePrompt: (prompt: string) => [
47
  `grayscale`,
48
  `intricate details`,
49
+ `japanese manga`,
50
+ prompt,
51
+ // "single panel",
52
+ // "manga",
53
+ // "japanese",
54
+ // "intricate",
55
+ // "detailed",
56
  // "drawing"
57
  ],
58
  negativePrompt: () => [
src/app/main.tsx CHANGED
@@ -71,7 +71,9 @@ export default function Main() {
71
  console.log("Sorry folks, the prompt was cut to:", limitedPrompt)
72
  }
73
 
74
- const panelPromptPrefix = preset.imagePrompt(limitedPrompt).join(", ")
 
 
75
 
76
  const newPanels: string[] = []
77
  const newCaptions: string[] = []
@@ -79,7 +81,16 @@ export default function Main() {
79
  console.log("Panel prompts for SDXL:")
80
  for (let p = 0; p < nbTotalPanels; p++) {
81
  newCaptions.push(llmResponse[p]?.caption || "...")
82
- const newPanel = [panelPromptPrefix, llmResponse[p]?.instructions || ""].map(chunk => chunk).join(", ")
 
 
 
 
 
 
 
 
 
83
  newPanels.push(newPanel)
84
  console.log(newPanel)
85
  }
 
71
  console.log("Sorry folks, the prompt was cut to:", limitedPrompt)
72
  }
73
 
74
+ // new experimental prompt: let's drop the user prompt!
75
+ const lightPanelPromptPrefix = preset.imagePrompt("").join(", ")
76
+ const degradedPanelPromptPrefix = preset.imagePrompt(limitedPrompt).join(", ")
77
 
78
  const newPanels: string[] = []
79
  const newCaptions: string[] = []
 
81
  console.log("Panel prompts for SDXL:")
82
  for (let p = 0; p < nbTotalPanels; p++) {
83
  newCaptions.push(llmResponse[p]?.caption || "...")
84
+ const newPanel = [
85
+
86
+ // what we do here is that ideally we give full control to the LLM for prompting,
87
+ // unless there was a catastrophic failure, in that case we preserve the original prompt
88
+ llmResponse[p]?.instructions
89
+ ? lightPanelPromptPrefix
90
+ : degradedPanelPromptPrefix,
91
+
92
+ llmResponse[p]?.instructions || ""
93
+ ].map(chunk => chunk).join(", ")
94
  newPanels.push(newPanel)
95
  console.log(newPanel)
96
  }