Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,12 +37,12 @@ t2i_transformer = LongCatImageTransformer2DModel.from_pretrained(
|
|
| 37 |
use_safetensors=True
|
| 38 |
).to(device)
|
| 39 |
|
| 40 |
-
|
| 41 |
t2i_model_id,
|
| 42 |
transformer=t2i_transformer,
|
| 43 |
text_processor=t2i_text_processor,
|
| 44 |
)
|
| 45 |
-
|
| 46 |
|
| 47 |
print(f"✅ Text-to-Image model loaded successfully")
|
| 48 |
|
|
@@ -120,7 +120,7 @@ def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidan
|
|
| 120 |
load_lora_auto(pipe, lora_id)
|
| 121 |
|
| 122 |
try:
|
| 123 |
-
image =
|
| 124 |
prompt=prompt,
|
| 125 |
negative_prompt="",
|
| 126 |
width=width,
|
|
|
|
| 37 |
use_safetensors=True
|
| 38 |
).to(device)
|
| 39 |
|
| 40 |
+
pipe = LongCatImagePipeline.from_pretrained(
|
| 41 |
t2i_model_id,
|
| 42 |
transformer=t2i_transformer,
|
| 43 |
text_processor=t2i_text_processor,
|
| 44 |
)
|
| 45 |
+
pipe.to(device, torch.bfloat16)
|
| 46 |
|
| 47 |
print(f"✅ Text-to-Image model loaded successfully")
|
| 48 |
|
|
|
|
| 120 |
load_lora_auto(pipe, lora_id)
|
| 121 |
|
| 122 |
try:
|
| 123 |
+
image = pipe(
|
| 124 |
prompt=prompt,
|
| 125 |
negative_prompt="",
|
| 126 |
width=width,
|