You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**VinA** is a visual novel generator. Once you specify a prompt on the type of
14
+
story you want, we generate an entire plot, detailed characters with
15
+
personalities, locations, music, and more. The result is a fully playable
16
+
and polished visual novel you can play.
17
+
18
+
## Example
19
+
20
+
With the following prompt:
21
+
```
22
+
Write a sci-fi story about a hackathon project gone haywire, where twofriends are working
23
+
together on a coding project over the weekend. Then, they are sucked into their laptop and
24
+
have to find a way back to reality. They overcome an obstacle and successfully return back home.
25
+
```
26
+
27
+
We get this visual novel.
28
+
29
+
## Features
30
+
31
+
Dynamic facial expressions depending on the dialogue
32
+
<div>
33
+
<imgsrc="media/lisa_base.png"width="30%" />
34
+
<imgsrc="media/lisa_cry.png"width="30%" />
35
+
</div>
36
+
<div>
37
+
<imgsrc="media/alex_base.png"width="30%" />
38
+
<imgsrc="media/alex_anger.png"width="30%" />
39
+
</div>
40
+
41
+
Generated background images for each scene
42
+
<div>
43
+
<imgsrc="media/bg0.png"width="70%" />
44
+
<imgsrc="media/bg1.png"width="70%" />
45
+
</div>
46
+
47
+
## Usage
48
+
49
+
To run **VinA** for yourself, you need the following:
50
+
- An OpenAI API key, find out how to get one [here](https://platform.openai.com/docs/api-reference/authentication)
51
+
- An instance of Automatic1111's stable diffusion web UI, ensure the instance you are using has API support. More info [here](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
52
+
- RenPy, installation instructions are [here](https://renpy.org/doc/html/quickstart.html)
53
+
54
+
The following environment variables should be set:
55
+
-`REN_PATH`: path to renpy executable
56
+
-`OPENAI_KEY`: your openai API key
57
+
-`NOVELAI_URL`: url to your instance of the stable diffusion web UI
58
+
59
+
## What's with the name?
60
+
61
+
**VinA** is an anagram of the much less creative name, 'AI VN'.
"description":"Genre of music that should be played in this scene",
182
187
},
183
188
"location":{
@@ -196,41 +201,48 @@ pub fn get_scenes_fn() -> Value {
196
201
"type":"string",
197
202
"description":"Landmarks and objects of focus that are present in the scene. Omit any descriptions of people.",
198
203
},
199
-
"mood":{
200
-
"type":"string",
201
-
"description":"Information about the mood. Omit any descriptions of people.",
202
-
},
203
204
"time_of_day":{
204
205
"type":"string",
205
206
"description":"What time of day it is",
206
207
},
207
208
}
208
209
},
209
-
"script":{
210
-
"type":"array",
211
-
"items":{
212
-
"type":"object",
213
-
"description":"A line in the script, contains information like the speaker, choose a facial expression from this list: smiling, crying, nervous, excited, blushing to match what is being said, and also what is being said",
214
-
"properties":{
215
-
"speaker":{
216
-
"type":"string",
217
-
"description":"Name of the speaker"
218
-
},
219
-
"facial_expression":{
220
-
"type":"string",
221
-
"description":"Use an emotion from this list: smiling, crying, nervous, excited, blushing to match the dialogue spoken"
222
-
},
223
-
"content":{
224
-
"type":"string",
225
-
"description":"What the speaker actually says"
226
-
}
227
-
}
228
-
}
210
+
}
211
+
}
212
+
},
213
+
},
214
+
"required":["inner"],
215
+
}
216
+
})
217
+
}
229
218
219
+
pubfnget_script_fn() -> Value{
220
+
json!({
221
+
"name":"get_script_fn",
222
+
"description":"Script to be used in scene",
223
+
"parameters":{
224
+
"type":"object",
225
+
"properties":{
226
+
"inner":{
227
+
"type":"array",
228
+
"items":{
229
+
"type":"object",
230
+
"description":"A line in the script, contains information like the speaker, what is being said, and facial expression",
231
+
"properties":{
232
+
"speaker":{
233
+
"type":"string",
234
+
"description":"Name of the speaker"
230
235
},
236
+
"facial_expression":{
237
+
"type":"string",
238
+
"description":"Use an emotion from this list: smiling, crying, nervous, excited, blushing to match the dialogue spoken"
let res = story_client.run_prompt(prompt,None).unwrap();
20
+
let game_name = parse_content(res)?;
19
21
20
22
story_client
21
-
.run_prompt("Generate a title for this story",None)
23
+
.run_prompt("Generate a short game title for this story",None)
22
24
.unwrap();
23
25
24
26
let res = story_client.run_prompt("Limit the number of characters to a maximum of 3. Give me each of the characters in the story, along with detailed personality, clothing, and physical appearance details (include age, race, gender).",Some(get_characters_fn())).unwrap();
25
27
26
28
let characters:Vec<Character> = parse_fncall(&res).unwrap();
27
29
// println!("CHARACTERS {:?}", characters);
28
30
29
-
let res = story_client.run_prompt("Limit the number of locations to a maximum of 5. Separate the story into multiple scenes, and for each scene give me a long and detailed description of the setting of the scene, omit any descriptions of people, include the name of the location, physical location it takes place in, objects and landmarks in the scene, mood, and time of day. Also create a title each scene that corresponds to the contents of the scene. Furthermore, for each scene, write me a script and return the result in a list with each element as a character's dialogue, and use a facial expression from this list: smiling, crying, nervous, excited, blushing to match the dialogue spoken. Also For each scene, tell me the music genre from this list Funky, Calm, Dark, Inspirational, Bright, Dramatic, Happy, Romantic, Angry, Sad",Some(get_scenes_fn())).unwrap();
31
+
let res = story_client.run_prompt("Separate the story into multiple scenes, and for each scene give me a long and detailed description of the setting of the scene, omit any descriptions of people, include the name of the location, physical location it takes place in, objects and landmarks in the scene, mood, and time of day. Also create a title each scene that corresponds to the contents of the scene. Furthermore, for each scene, write me a script and return the result in a list with each element as a character's dialogue, and use a facial expression from this list: smiling, crying, nervous, excited, blushing to match the dialogue spoken. Also For each scene, tell me the music genre from this list Funky, Calm, Dark, Inspirational, Bright, Dramatic, Happy, Romantic, Angry, Sad",Some(get_scenes_fn())).unwrap();
r#"For scene {scene_number}, write me a script with a lot of speaking. Prioritize number of lines of dialogue. When writing each line of dialogue, take into account the personality and mood of the character as well as the setting. Do not use a narrator. Ensure that the script transitions smoothly into the next scene. Return the result in a list. Also include facial expression from this list: smiling, crying, nervous, excited, blushing to match the dialogue spoken. Output as json."#
42
+
);
43
+
let res = story_client
44
+
.run_prompt(&prompt,Some(get_script_fn()))
45
+
.unwrap();
46
+
47
+
let script:Vec<Dialogue> = parse_fncall(&res).unwrap();
0 commit comments