TryChAI commited on
Commit
0497ff4
·
1 Parent(s): 9427d07

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +1 -124
index.html CHANGED
@@ -12,127 +12,4 @@
12
  <p>You can create very complex prompts <br> by using very few words.</p>
13
  <p>
14
  Also don't forget to check the creators of this app
15
- <a href="https://trychai.org" target="_blank">TRYCHAI</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
20
- <div class="w-100 text-center"><p class="h6"><!DOCTYPE html>
21
- <html>
22
- <head>
23
- <title>Midjourney Prompt Generator</title>
24
- <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
25
- </head>
26
- <body>
27
- <div class="container mt-5">
28
- <h1 class="text-center">Midjourney Prompt Machine</h1>
29
- <form id="promptForm">
30
- <div class="form-group">
31
- <label for="description">Enter Description:</label>
32
- <textarea class="form-control" id="description" name="description" rows="6" required></textarea>
33
- </div>
34
- <div class="form-group">
35
- <label for="numPrompts">Number of prompts to output:</label>
36
- <input class="form-control" id="numPrompts" name="numPrompts" value="4" min="1" max="5" type="number" required></textarea>
37
- </div>
38
- <button type="submit" class="btn btn-primary">Generate Prompt</button>
39
- </form>
40
-
41
- <hr>
42
-
43
- <div id="outputDiv" class="mt-4"></div>
44
- <button id="copyButton" class="btn btn-secondary mt-2">Copy Text</button>
45
-
46
- </div>
47
-
48
- <script>
49
- const apiKey = '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'; // Replace with your actual API key
50
- const apiUrl = 'https://api.openai.com/v1/chat/completions';
51
- const responseDiv = document.getElementById('outputDiv');
52
-
53
- function generateResponse(prompt) {
54
- const data = {
55
- model: 'gpt-3.5-turbo',
56
- messages: [{ role: 'system', content: 'You are a prompt generator for Midjourney.' }, { role: 'user', content: prompt }],
57
- };
58
-
59
- fetch(apiUrl, {
60
- method: 'POST',
61
- headers: {
62
- 'Content-Type': 'application/json',
63
- 'Authorization': `Bearer ${apiKey}`,
64
- },
65
- body: JSON.stringify(data),
66
- })
67
- .then(response => response.json())
68
- .then(data => {
69
- const reply = data.choices[0].message.content;
70
- responseDiv.innerHTML = `<p>${reply}</p>`;
71
- })
72
- .catch(error => {
73
- console.error('Error:', error);
74
- responseDiv.innerHTML = `<p><strong>Error:</strong> ${error}</p>`;
75
- });
76
- }
77
-
78
- document.getElementById('promptForm').addEventListener('submit', function(event) {
79
- event.preventDefault();
80
- const letterNums = ['zero','one', 'two', 'three', 'four', 'five'];
81
- const description = document.getElementById('description').value;
82
- let numPrompts = parseInt(document.getElementById('numPrompts').value);
83
- numPrompts = letterNums[numPrompts].toUpperCase();
84
- const formattedPrompt = `<p>
85
- As a prompt generator for a generative AI called "Midjourney", you will create image prompts for the AI to visualize. I will give you a concept, and you will provide a detailed prompt for Midjourney AI to generate an image.
86
-
87
- Please adhere to the structure and formatting below, and follow these guidelines:
88
-
89
- - Do not use the words "description" or ":" in any form.
90
- - Do not place a comma between [ar] and [v].
91
- - Write each prompt in one line without using return.
92
-
93
- Structure:
94
- [1] = ${description}
95
- [2] = a detailed description of [1] with specific imagery details.
96
- [3] = a detailed description of the scene's environment.
97
- [4] = a detailed description of the scene's mood, feelings, and atmosphere.
98
- [5] = A style (e.g. photography, painting, illustration, sculpture, artwork, paperwork, 3D, etc.) for [1].
99
- [6] = A description of how [5] will be executed (e.g. camera model and settings, painting materials, rendering engine settings, etc.)
100
- [ar] = Use "--ar 16:9" for horizontal images, "--ar 9:16" for vertical images, or "--ar 1:1" for square images.
101
- [v] = Use "--niji" for Japanese art style, or "--v 5" for other styles.
102
-
103
- Formatting:
104
- Follow this prompt structure: "/imagine prompt: [1], [2], [3], [4], [5], [6], [ar] [v]".
105
-
106
- Your task: Create '${numPrompts}' distinct prompt${(numPrompts=='one')?'':'s'} (and just ${numPrompts} please! not more not less) for each concept [1], varying in description, environment, atmosphere, and realization.
107
-
108
- - Write your prompts in English.
109
- - Do not describe unreal concepts as "real" or "photographic".
110
- - Include one realistic photographic style prompt with lens type and size.
111
- - Separate different prompts with two new lines.
112
-
113
- Example Prompts:
114
- Prompt 1:
115
- /imagine prompt: A stunning Halo Reach landscape with a Spartan on a hilltop, lush green forests surround them, clear sky, distant city view, focusing on the Spartan's majestic pose, intricate armor, and weapons, Artwork, oil painting on canvas, --ar 16:9 --v 5
116
-
117
- Prompt 2:
118
- /imagine prompt: A captivating Halo Reach landscape with a Spartan amidst a battlefield, fallen enemies around, smoke and fire in the background, emphasizing the Spartan's determination and bravery, detailed environment blending chaos and beauty, Illustration, digital art, --ar 16:9 -- v 5
119
- </p>`;
120
- responseDiv.innerHTML = '<p>Generating...<br>Please wait!</p>';
121
-
122
- generateResponse(formattedPrompt);
123
- });
124
-
125
- document.getElementById('copyButton').addEventListener('click', function() {
126
- const promptText = document.getElementById('outputDiv').innerText;
127
- const textArea = document.createElement('textarea');
128
- textArea.value = promptText;
129
- document.body.appendChild(textArea);
130
- textArea.select();
131
- document.execCommand('copy');
132
- document.body.removeChild(textArea);
133
-
134
- alert('Prompt text copied to clipboard!');
135
- });
136
- </script>
137
- </body>
138
- </html></p></div>
 
12
  <p>You can create very complex prompts <br> by using very few words.</p>
13
  <p>
14
  Also don't forget to check the creators of this app
15
+