seawolf2357 commited on
Commit
649012a
ยท
verified ยท
1 Parent(s): d6dc9a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -5,7 +5,7 @@ import uuid
5
  import torch
6
  import subprocess
7
  from huggingface_hub import snapshot_download
8
- from diffusers import StableDiffusion3Pipeline, StableDiffusion3Img2ImgPipeline
9
  from transformers import pipeline
10
 
11
  # ๋กœ๊น… ์„ค์ •
@@ -19,9 +19,7 @@ intents.message_content = True
19
  huggingface_token = os.getenv("HF_TOKEN")
20
  model_path = snapshot_download(
21
  repo_id="Corcelio/mobius",
22
- revision="refs/pr/26",
23
  repo_type="model",
24
- ignore_patterns=[".md", "..gitattributes"],
25
  local_dir="mobius",
26
  token=huggingface_token,
27
  )
@@ -30,9 +28,9 @@ model_path = snapshot_download(
30
  def load_pipeline(pipeline_type):
31
  logging.debug(f'ํŒŒ์ดํ”„๋ผ์ธ ๋กœ๋“œ ์ค‘: {pipeline_type}')
32
  if pipeline_type == "text2img":
33
- return StableDiffusion3Pipeline.from_pretrained(model_path, torch_dtype=torch.float16, use_fast=True)
34
  elif pipeline_type == "img2img":
35
- return StableDiffusion3Img2ImgPipeline.from_pretrained(model_path, torch_dtype=torch.float16, use_fast=True)
36
 
37
  # ๋””๋ฐ”์ด์Šค ์„ค์ •
38
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
 
5
  import torch
6
  import subprocess
7
  from huggingface_hub import snapshot_download
8
+ from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline
9
  from transformers import pipeline
10
 
11
  # ๋กœ๊น… ์„ค์ •
 
19
  huggingface_token = os.getenv("HF_TOKEN")
20
  model_path = snapshot_download(
21
  repo_id="Corcelio/mobius",
 
22
  repo_type="model",
 
23
  local_dir="mobius",
24
  token=huggingface_token,
25
  )
 
28
  def load_pipeline(pipeline_type):
29
  logging.debug(f'ํŒŒ์ดํ”„๋ผ์ธ ๋กœ๋“œ ์ค‘: {pipeline_type}')
30
  if pipeline_type == "text2img":
31
+ return StableDiffusionPipeline.from_pretrained(model_path, torch_dtype=torch.float16, use_fast=True)
32
  elif pipeline_type == "img2img":
33
+ return StableDiffusionImg2ImgPipeline.from_pretrained(model_path, torch_dtype=torch.float16, use_fast=True)
34
 
35
  # ๋””๋ฐ”์ด์Šค ์„ค์ •
36
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")