Spaces:
Running
on
Zero
Running
on
Zero
alfredplpl
commited on
Commit
•
e898b56
1
Parent(s):
3eb1649
Update app.py
Browse files
app.py
CHANGED
@@ -106,18 +106,28 @@ def auto_prompt_correction(prompt_ui,neg_prompt_ui,disable_auto_prompt_correctio
|
|
106 |
return prompt,neg_prompt
|
107 |
|
108 |
def txt_to_img(prompt, neg_prompt, guidance, steps, width, height, generator):
|
109 |
-
conditioning, pooled = compel([prompt, neg_prompt])
|
110 |
-
|
111 |
result = pipe(
|
112 |
-
|
113 |
-
|
114 |
-
negative_prompt_embeds=conditioning[1:2],
|
115 |
-
negative_pooled_prompt_embeds=pooled[1:2],
|
116 |
num_inference_steps = int(steps),
|
117 |
guidance_scale = guidance,
|
118 |
width = width,
|
119 |
height = height,
|
120 |
generator = generator)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
return result.images[0]
|
123 |
|
|
|
106 |
return prompt,neg_prompt
|
107 |
|
108 |
def txt_to_img(prompt, neg_prompt, guidance, steps, width, height, generator):
|
|
|
|
|
109 |
result = pipe(
|
110 |
+
prompt=prompt
|
111 |
+
negative_prompt=neg_prompt,
|
|
|
|
|
112 |
num_inference_steps = int(steps),
|
113 |
guidance_scale = guidance,
|
114 |
width = width,
|
115 |
height = height,
|
116 |
generator = generator)
|
117 |
+
|
118 |
+
if(0):
|
119 |
+
conditioning, pooled = compel([prompt, neg_prompt])
|
120 |
+
|
121 |
+
result = pipe(
|
122 |
+
prompt_embeds=conditioning[0:1],
|
123 |
+
pooled_prompt_embeds=pooled[0:1],
|
124 |
+
negative_prompt_embeds=conditioning[1:2],
|
125 |
+
negative_pooled_prompt_embeds=pooled[1:2],
|
126 |
+
num_inference_steps = int(steps),
|
127 |
+
guidance_scale = guidance,
|
128 |
+
width = width,
|
129 |
+
height = height,
|
130 |
+
generator = generator)
|
131 |
|
132 |
return result.images[0]
|
133 |
|