@@ -7,13 +7,15 @@ repo due to the size of the content, and the ability to easily generate your own
7
7
8
8
The Social browser helper expects a directory tree of static content that is used to make posts to Socializer.
9
9
The format of the social content directory is assumed as:
10
- ` <social-content-directory>/ topicdirs(multiple) / postdirs (mulitple) / post.txt, image*.png `
10
+ ` <social-content-directory>/ topicdirs(multiple) / postdirs (mulitple) / post.txt, image*.png or image*.jpg `
11
11
12
- When the Social Browser, various ` ollama ` LLMs were used to generate text, and Stable Diffusion AI was used to
12
+ When the Social Browser, various ` ollama ` LLMs were used to generate text, and Stable Diffusion AI and Dalle3 was used to
13
13
generate images.
14
14
15
15
You will need to install ` ollama ` and Python+ollama library to generate the text files.
16
16
You will need to install the Stable Diffusion AI tool on your local PC in order to generate images.
17
+ You will need to have an OpenAI account and ($$) to use dall-e-3 -- this gives better images than Stable AI
18
+ but is more restrictive in its prompts and costs $$ for each image.
17
19
18
20
There was not a lot of effort expended on these scripts, they were done in one weekend so feel free to
19
21
improve to your particular needs!
@@ -29,15 +31,17 @@ LLM name and post number to distinguish when different LLMs are used for the sam
29
31
cleaning up posts to know what LLM was used to generate the post.
30
32
31
33
2 . Use the ` gen_social_posts.py ` script to read a topic YML file - this reads each topic prompt, feed its to a LLM, captures
32
- the output, and saves the output as a post file. There are variables in ` gen_soical_posts .py` script to specifiy which LLMs to
34
+ the output, and saves the output as a post file. There are variables in ` gen_socoal_posts .py` script to specifiy which LLMs to
33
35
use to generate the post topics. The ` gen_social_posts.py ` script includes a function named ` gen_prompts ` from the
34
36
` gen_topics_common.py ` file to do the work of generating the post, and also attempts to clean up the post a bit after
35
37
it is generated.
36
38
37
39
38
- ## Generating Images
40
+ ## Generating Images/Stable AI
39
41
40
- Images are optional, they are only posted if avaiable.
42
+ Images are optional, they are only posted if avaiable. The default format that is generated is .PNG,
43
+ but this should be converted to a JPG after the fact to save disk space (the script convert_all_images.py
44
+ can be used to do this).
41
45
42
46
This assumes that the Stable Diffusion AI is running on the local host and can be accessed at the
43
47
standard port of ` 127.0.0.1:7860 ` .
@@ -60,19 +64,43 @@ Stable AI and you can modify some of the parameters
60
64
The quality of the images is not very good but should ok for traffic gen and laughs.
61
65
62
66
67
+ ## Generating Images/Dall-e-3
68
+
69
+ To generate images with dall-e-3 you will need an Open AI account, and put some $$ into your account in order
70
+ to generate an image. You will also need to generate an API key on your account - you can use the
71
+ the ` dall3_test.py ` script to test out your API key and image gen.
72
+
73
+ Once you have an API key working, you will need to add it in to ` gen_topics_common.py ` file in the ` gen_dalle3_images `
74
+ function. The script ` gen_dalle3_prompts.py ` can be used to generate prompts, and the ` gen_dalle3_image.py ` script
75
+ to generate images from the prompts. Dall-e-3 generates better looking images than Stable AI but does
76
+ not allow style guidance (ie, 'in the style of SoandSo') and is in general more restrictive over what can be used in a prompt.
77
+
78
+
63
79
## Suggested Steps
64
80
65
81
First, just try creating 50 posts using the ` gen_social_posts.py ` script and ` animal_content.yml ` data file.
66
82
Then try creating images for these posts using the ` gen_stable_ai_images.py ` script.
67
83
68
84
Once you get familar with this flow, you can change the LLM used in the ` gen_social_posts.py ` script and generate
69
- 50 more posts about animals using a different LLM.
85
+ 50 more posts about animals using a different LLM.
70
86
71
- Or, you can try making a content file for a different topic - currently there are four content/prompt generator files:
87
+ For images, it is best to stick with one LLM for generating prompts - gemma seemed to be the best.
88
+ For post content, you can use different LLMs but different LLMs end up sticking different extraneous stuff
89
+ in the post that has to filtered out. Sticking with one LLM for post content makes it easier, but then the posts
90
+ end up looking the same.
91
+
92
+ Or, you can try making a content file for a different topic - currently there are 11 content/prompt generator files:
72
93
1 . animal_content.yml (prompt generator is ` gen_animal_topics.py ` )
73
94
1 . movie_content.yml (prompt generator is ` gen_movie_topics.py ` )
74
95
1 . product_content.yml (prompt generator is ` gen_product_topics.py ` )
75
96
1 . travel_content.yml (prompt generator is ` gen_travel_topics.py ` )
97
+ 1 . anime_content.yml (prompt generator is ` gen_anime_topics.py ` )
98
+ 1 . astronomy_content.yml (prompt generator is ` gen_astronomy_topics.py ` )
99
+ 1 . music_content.yml (prompt generator is ` gen_music_topics.py ` )
100
+ 1 . paranormal_content.yml (prompt generator is ` gen_paranormal_topics.py ` )
101
+ 1 . science_content.yml (prompt generator is ` gen_science_topics.py ` )
102
+ 1 . history_content.yml (prompt generator is ` gen_history_topics.py ` )
103
+ 1 . sports_content.yml (prompt generator is ` gen_sports_topics.py ` )
76
104
77
105
78
106
You should be able to easily generate enough static content to satisfy traffic generator needs.
@@ -91,6 +119,10 @@ Here are links on various topics:
91
119
1 . Ollama Python library - https://github.com/ollama/ollama-python
92
120
1 . Ollama LLM Model list - https://ollama.com/library
93
121
2 . Stable Diffusion AI API Guide - https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/API#api-guide-by-kilvoctu
122
+ 3 . Open AI Python library: https://github.com/openai/openai-python
123
+ 4 . Open AI playground: https://platform.openai.com/
124
+
125
+
94
126
95
127
96
128
0 commit comments