Spaces:
Running
on
L40S
Running
on
L40S
Update app.py
Browse files
app.py
CHANGED
@@ -320,8 +320,7 @@ if __name__ == "__main__":
|
|
320 |
try:
|
321 |
# 3D ์์ฑ ํ์ดํ๋ผ์ธ
|
322 |
pipeline = TrellisImageTo3DPipeline.from_pretrained(
|
323 |
-
"JeffreyXiang/TRELLIS-image-large"
|
324 |
-
token=HF_TOKEN # use_auth_token ๋์ token ์ฌ์ฉ
|
325 |
)
|
326 |
pipeline.to(device)
|
327 |
|
@@ -329,7 +328,7 @@ if __name__ == "__main__":
|
|
329 |
pipe = FluxPipeline.from_pretrained(
|
330 |
"black-forest-labs/FLUX.1-dev",
|
331 |
torch_dtype=torch.bfloat16,
|
332 |
-
|
333 |
device_map="auto"
|
334 |
)
|
335 |
|
@@ -337,7 +336,7 @@ if __name__ == "__main__":
|
|
337 |
lora_path = hf_hub_download(
|
338 |
"ByteDance/Hyper-SD",
|
339 |
"Hyper-FLUX.1-dev-8steps-lora.safetensors",
|
340 |
-
|
341 |
)
|
342 |
pipe.load_lora_weights(lora_path)
|
343 |
pipe.fuse_lora(lora_scale=0.125)
|
@@ -346,9 +345,13 @@ if __name__ == "__main__":
|
|
346 |
translator = pipeline(
|
347 |
"translation",
|
348 |
model="Helsinki-NLP/opus-mt-ko-en",
|
349 |
-
device=
|
350 |
)
|
351 |
|
|
|
|
|
|
|
|
|
352 |
# ์ด๊ธฐ ์ด๋ฏธ์ง ์ ์ฒ๋ฆฌ ํ
์คํธ
|
353 |
try:
|
354 |
test_image = Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8))
|
|
|
320 |
try:
|
321 |
# 3D ์์ฑ ํ์ดํ๋ผ์ธ
|
322 |
pipeline = TrellisImageTo3DPipeline.from_pretrained(
|
323 |
+
"JeffreyXiang/TRELLIS-image-large"
|
|
|
324 |
)
|
325 |
pipeline.to(device)
|
326 |
|
|
|
328 |
pipe = FluxPipeline.from_pretrained(
|
329 |
"black-forest-labs/FLUX.1-dev",
|
330 |
torch_dtype=torch.bfloat16,
|
331 |
+
use_auth_token=HF_TOKEN, # token ๋์ use_auth_token ์ฌ์ฉ
|
332 |
device_map="auto"
|
333 |
)
|
334 |
|
|
|
336 |
lora_path = hf_hub_download(
|
337 |
"ByteDance/Hyper-SD",
|
338 |
"Hyper-FLUX.1-dev-8steps-lora.safetensors",
|
339 |
+
use_auth_token=HF_TOKEN # token ๋์ use_auth_token ์ฌ์ฉ
|
340 |
)
|
341 |
pipe.load_lora_weights(lora_path)
|
342 |
pipe.fuse_lora(lora_scale=0.125)
|
|
|
345 |
translator = pipeline(
|
346 |
"translation",
|
347 |
model="Helsinki-NLP/opus-mt-ko-en",
|
348 |
+
device=device
|
349 |
)
|
350 |
|
351 |
+
# CUDA ๋ฉ๋ชจ๋ฆฌ ์ด๊ธฐํ
|
352 |
+
if torch.cuda.is_available():
|
353 |
+
torch.cuda.empty_cache()
|
354 |
+
|
355 |
# ์ด๊ธฐ ์ด๋ฏธ์ง ์ ์ฒ๋ฆฌ ํ
์คํธ
|
356 |
try:
|
357 |
test_image = Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8))
|