Update app.py
Browse files
app.py
CHANGED
@@ -10,22 +10,7 @@ def create_model(loc = "stabilityai/stable-diffusion-2-1-base", mch = 'cuda'):
|
|
10 |
pipe = StableDiffusionPipeline.from_pretrained(loc, torch_dtype=torch.float16)
|
11 |
pipe = pipe.to(mch)
|
12 |
return pipe
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
openai.api_key = "please-paste-your-API-key-here"
|
17 |
-
|
18 |
-
def chatWithGPT(prompt):
|
19 |
-
completion = openai.ChatCompletion.create(
|
20 |
-
model="gpt-3.5-turbo",
|
21 |
-
messages=[
|
22 |
-
{"role": "expert in creating prompts for stable diffusion", "content": prompt}
|
23 |
-
]
|
24 |
-
)
|
25 |
-
return print(completion.choices[0].message.content)
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
t2i = st.checkbox("Text2Image")
|
30 |
|
31 |
if t2i:
|
|
|
10 |
pipe = StableDiffusionPipeline.from_pretrained(loc, torch_dtype=torch.float16)
|
11 |
pipe = pipe.to(mch)
|
12 |
return pipe
|
13 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
t2i = st.checkbox("Text2Image")
|
15 |
|
16 |
if t2i:
|