Ifeanyi commited on
Commit
1636073
1 Parent(s): da037f1

promptGenerator files

Browse files
Files changed (3) hide show
  1. app.py +24 -0
  2. boy 2.jpeg +0 -0
  3. requirements.txt +3 -0
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ def PromptGenerator(prompt):
5
+ pipe = pipeline("text-generation", model="Gustavosta/MagicPrompt-Stable-Diffusion")
6
+
7
+ prompt = pipe(prompt)
8
+
9
+ prompt = prompt[0]
10
+
11
+ prompt = prompt["generated_text"]
12
+
13
+ return prompt
14
+
15
+ app = gr.Interface(PromptGenerator,
16
+ inputs = "text",
17
+ outputs = "text",
18
+ theme = gr.themes.Soft(primary_hue="blue",secondary_hue="stone"),
19
+ title = "AI Prompt Generator",
20
+ examples = ["Landscape of","Pixar style little girl","A racecar driving","Fireflies at night"],
21
+ css = ".gradio-container {background: url('file=/content/sample_data/boy 2.jpeg')}"
22
+ )
23
+
24
+ app.launch()
boy 2.jpeg ADDED
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ transformers
2
+ xformers
3
+ gradio