-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
94 lines (92 loc) · 5.18 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Easily create weighted multi prompts for Midjourney, an AI tool generating images from textual descriptions (prompts).">
<title>Midjourney Multi Prompt Weight Calculator</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Midjourney Multi Prompt Weight Calculator</h1>
<p>
Easily create <a href="https://docs.midjourney.com/docs/multi-prompts">weighted multi prompts</a> for <a href="https://www.midjourney.com/">Midjourney</a>, an AI tool generating images from textual descriptions (prompts). This calculator does the weight distribution; add <a href="https://docs.midjourney.com/docs/parameter-list">extra parameters</a> manually (stylize, seed, aspect).
</p>
<!-- Overlay content -->
<button id="showInstructions" title="View detailed instructions" aria-label="View detailed instructions">Instructions</button>
<div class="overlay" id="instructionsOverlay">
<div class="overlay-content">
<h2>Instructions</h2>
<ol>
<li><strong>Global Weights:</strong> How much "strength" the positive prompts have compared to the negative prompts. By default positive prompts account for 60% of the weight. The tool calculates negative weight automatically. Since Midjourney requires that <a href="https://docs.midjourney.com/docs/multi-prompts#negative-prompt-weights">the sum of ALL weights must be a positive number</a>, the minimum strength of positive weights are 51%.</li>
<li><strong>Generated Multi Prompt:</strong> Displays the generated prompt. Use the "Copy" button for easy use in Midjourney.</li>
<li><strong>Positive/Negative Prompts:</strong> Specify the count of each, then provide the prompt text in their respective input boxes. Max of 9 prompts each. This is an arbitrary limitation for best practices, not a Midjourney requirement.</li>
<li><strong>Clear Local Storage:</strong> Resets the tool and clears any saved data.</li>
</ol>
<p>
Refer to <a href="https://docs.midjourney.com/docs/quick-start">Midjourney's official documentation</a> for more on prompts.
</p>
<button id="closeInstructions" title="Close the instructions" aria-label="Close the instructions">Close</button>
</div>
</div>
<section>
<legend>Global Weights</legend>
<div class="input-group">
<label class="input-group__label" for="positiveWeight">Positive Weight:</label>
<input type="range" id="positiveWeight" value="60" min="51" max="100"><span id="positiveWeightValue">60</span><span>%</span>
</div>
<div class="input-group">
<label class="input-group__label" for="negativeWeightValue">Negative Weight:</label>
<input type="number" id="negativeWeightValue" readonly><span>%</span>
</div>
<p>
Input the positive weight. Negative weight is calculated automatically.
<br>
<em>Example: For an image of the "Swiss Alps with less houses and trees", set positive weight to 60%. The remaining 40% is the negative weight.</em>
</p>
</section>
<section>
<legend>Generated Multi Prompt</legend>
<div class="input-group result-group">
<label class="input-group__label" for="result">/imagine </label>
<input type="text" id="result" class="result-input" readonly>
</div>
<div class="input-group">
<button id="copyToClipboard" title="Copy the generated prompt to clipboard">Copy</button>
</div>
<p>
Your multi prompt appears here. Use the "Copy" button for easy use in Midjourney.
</p>
</section>
<section>
<legend>Positive Prompts</legend>
<div class="input-group">
<label class="input-group__label" for="positivePromptCount">Count:</label>
<button id="positivePromptDecrement" type="button"></button>
<input type="text" id="positivePromptCount" value="1" readonly>
<button id="positivePromptIncrement" type="button"></button>
</div>
<div id="positive-prompts-container"></div>
<p>
Specify the count of positive prompts, then provide the text for each in the given input boxes. Positive prompts emphasize desired image elements.
</p>
</section>
<section>
<legend>Negative Prompts</legend>
<div class="input-group">
<label class="input-group__label" for="negativePromptCount">Count:</label>
<button id="negativePromptDecrement" type="button"></button>
<input type="text" id="negativePromptCount" value="1" readonly>
<button id="negativePromptIncrement" type="button"></button>
</div>
<div id="negative-prompts-container"></div>
<p>
Specify the count of negative prompts, then provide the text for each in the given input boxes. Negative prompts help eliminate unwanted image elements.
</p>
</section>
<button id="clearLocalStorage" title="Reset the tool and clear saved data" aria-label="Reset the tool and clear saved data">Clear</button>
<p class="credit"><em>By <a href="https://www.gpromptyourself.com/">Matt Westgate</a>. Author of <a href="https://a.co/d/30EYZAS">Go Prompt Yourself!</a></em></p>
<div id="toast"></div>
<script src="main.js"></script>
</body>
</html>