Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -81,7 +81,6 @@ def process_text(prompt):
|
|
| 81 |
print("prompt: \n", prompt_trans)
|
| 82 |
return prompt_trans
|
| 83 |
|
| 84 |
-
process_text("外面做一个测试")
|
| 85 |
|
| 86 |
@spaces.GPU
|
| 87 |
def generate(
|
|
@@ -110,16 +109,16 @@ def generate(
|
|
| 110 |
if not use_negative_prompt_2:
|
| 111 |
negative_prompt_2 = None # type: ignore
|
| 112 |
|
| 113 |
-
process_text("里面做一个测试")
|
| 114 |
-
print("prompt是:", prompt)
|
| 115 |
-
print("negative_prompt是:", negative_prompt)
|
| 116 |
-
print("prompt_2是:", prompt_2)
|
| 117 |
-
print("negative_prompt_2是:", negative_prompt_2)
|
| 118 |
|
| 119 |
if not apply_refiner:
|
| 120 |
return pipe(
|
| 121 |
-
prompt=prompt,
|
| 122 |
-
negative_prompt=negative_prompt,
|
| 123 |
prompt_2=prompt_2,
|
| 124 |
negative_prompt_2=negative_prompt_2,
|
| 125 |
width=width,
|
|
@@ -131,8 +130,8 @@ def generate(
|
|
| 131 |
).images[0]
|
| 132 |
else:
|
| 133 |
latents = pipe(
|
| 134 |
-
prompt=prompt,
|
| 135 |
-
negative_prompt=negative_prompt,
|
| 136 |
prompt_2=prompt_2,
|
| 137 |
negative_prompt_2=negative_prompt_2,
|
| 138 |
width=width,
|
|
@@ -143,8 +142,8 @@ def generate(
|
|
| 143 |
output_type="latent",
|
| 144 |
).images
|
| 145 |
image = refiner(
|
| 146 |
-
prompt=prompt,
|
| 147 |
-
negative_prompt=negative_prompt,
|
| 148 |
prompt_2=prompt_2,
|
| 149 |
negative_prompt_2=negative_prompt_2,
|
| 150 |
guidance_scale=guidance_scale_refiner,
|
|
|
|
| 81 |
print("prompt: \n", prompt_trans)
|
| 82 |
return prompt_trans
|
| 83 |
|
|
|
|
| 84 |
|
| 85 |
@spaces.GPU
|
| 86 |
def generate(
|
|
|
|
| 109 |
if not use_negative_prompt_2:
|
| 110 |
negative_prompt_2 = None # type: ignore
|
| 111 |
|
| 112 |
+
# process_text("里面做一个测试")
|
| 113 |
+
# print("prompt是:", prompt)
|
| 114 |
+
# print("negative_prompt是:", negative_prompt)
|
| 115 |
+
# print("prompt_2是:", prompt_2)
|
| 116 |
+
# print("negative_prompt_2是:", negative_prompt_2)
|
| 117 |
|
| 118 |
if not apply_refiner:
|
| 119 |
return pipe(
|
| 120 |
+
prompt=process_text(prompt),
|
| 121 |
+
negative_prompt=process_text(negative_prompt),
|
| 122 |
prompt_2=prompt_2,
|
| 123 |
negative_prompt_2=negative_prompt_2,
|
| 124 |
width=width,
|
|
|
|
| 130 |
).images[0]
|
| 131 |
else:
|
| 132 |
latents = pipe(
|
| 133 |
+
prompt=process_text(prompt),
|
| 134 |
+
negative_prompt=process_text(negative_prompt),
|
| 135 |
prompt_2=prompt_2,
|
| 136 |
negative_prompt_2=negative_prompt_2,
|
| 137 |
width=width,
|
|
|
|
| 142 |
output_type="latent",
|
| 143 |
).images
|
| 144 |
image = refiner(
|
| 145 |
+
prompt=process_text(prompt),
|
| 146 |
+
negative_prompt=process_text(negative_prompt),
|
| 147 |
prompt_2=prompt_2,
|
| 148 |
negative_prompt_2=negative_prompt_2,
|
| 149 |
guidance_scale=guidance_scale_refiner,
|