Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -68,7 +68,7 @@ def load_model():
|
|
| 68 |
MODEL_NAME,
|
| 69 |
subfolder="text_encoder",
|
| 70 |
torch_dtype=dtype,
|
| 71 |
-
).to(
|
| 72 |
|
| 73 |
# Tokenizer / Processor
|
| 74 |
tokenizer = AutoTokenizer.from_pretrained(
|
|
@@ -153,8 +153,8 @@ def process_images(
|
|
| 153 |
result = pipe(
|
| 154 |
images[0],
|
| 155 |
prompt=prompt,
|
| 156 |
-
height=
|
| 157 |
-
width=
|
| 158 |
negative_prompt=" ",
|
| 159 |
num_inference_steps=num_steps,
|
| 160 |
true_cfg_scale=true_cfg_scale,
|
|
@@ -164,8 +164,8 @@ def process_images(
|
|
| 164 |
result = pipe(
|
| 165 |
images=images,
|
| 166 |
prompt=prompt,
|
| 167 |
-
height=
|
| 168 |
-
width=
|
| 169 |
negative_prompt=" ",
|
| 170 |
num_inference_steps=num_steps,
|
| 171 |
true_cfg_scale=true_cfg_scale,
|
|
@@ -194,7 +194,6 @@ with gr.Blocks(
|
|
| 194 |
|
| 195 |
- **Model**: UniPic-3 DMD
|
| 196 |
- **Inference**: 8-step fast generation
|
| 197 |
-
- **GPU-only Hugging Face Space**
|
| 198 |
"""
|
| 199 |
)
|
| 200 |
|
|
@@ -240,7 +239,7 @@ with gr.Blocks(
|
|
| 240 |
# -----------------------------------------------------------------------------
|
| 241 |
@GPU
|
| 242 |
def main():
|
| 243 |
-
demo.launch()
|
| 244 |
|
| 245 |
|
| 246 |
if __name__ == "__main__":
|
|
|
|
| 68 |
MODEL_NAME,
|
| 69 |
subfolder="text_encoder",
|
| 70 |
torch_dtype=dtype,
|
| 71 |
+
).to('cpu')
|
| 72 |
|
| 73 |
# Tokenizer / Processor
|
| 74 |
tokenizer = AutoTokenizer.from_pretrained(
|
|
|
|
| 153 |
result = pipe(
|
| 154 |
images[0],
|
| 155 |
prompt=prompt,
|
| 156 |
+
height=512,
|
| 157 |
+
width=512,
|
| 158 |
negative_prompt=" ",
|
| 159 |
num_inference_steps=num_steps,
|
| 160 |
true_cfg_scale=true_cfg_scale,
|
|
|
|
| 164 |
result = pipe(
|
| 165 |
images=images,
|
| 166 |
prompt=prompt,
|
| 167 |
+
height=512,
|
| 168 |
+
width=512,
|
| 169 |
negative_prompt=" ",
|
| 170 |
num_inference_steps=num_steps,
|
| 171 |
true_cfg_scale=true_cfg_scale,
|
|
|
|
| 194 |
|
| 195 |
- **Model**: UniPic-3 DMD
|
| 196 |
- **Inference**: 8-step fast generation
|
|
|
|
| 197 |
"""
|
| 198 |
)
|
| 199 |
|
|
|
|
| 239 |
# -----------------------------------------------------------------------------
|
| 240 |
@GPU
|
| 241 |
def main():
|
| 242 |
+
demo.launch(ssr_mode=False)
|
| 243 |
|
| 244 |
|
| 245 |
if __name__ == "__main__":
|