atef91 commited on
Commit
08c73ce
·
verified ·
1 Parent(s): f8f5f68

Upload 3 files

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. requirements.txt +0 -2
app.py CHANGED
@@ -8,7 +8,7 @@ warnings.filterwarnings('ignore')
8
  # Constants
9
  MODEL_ID = "runwayml/stable-diffusion-v1-5"
10
  DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
11
- DTYPE = torch.float16 if DEVICE == "cuda" else torch.float32
12
 
13
  class FooocusGenerator:
14
  def __init__(self):
@@ -21,7 +21,7 @@ class FooocusGenerator:
21
  self.pipe = StableDiffusionPipeline.from_pretrained(
22
  MODEL_ID,
23
  torch_dtype=DTYPE,
24
- revision="fp16" if DEVICE == "cuda" else "fp32"
25
  )
26
 
27
  if DEVICE == "cuda":
 
8
  # Constants
9
  MODEL_ID = "runwayml/stable-diffusion-v1-5"
10
  DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
11
+ DTYPE = torch.float32 # Using float32 for better compatibility
12
 
13
  class FooocusGenerator:
14
  def __init__(self):
 
21
  self.pipe = StableDiffusionPipeline.from_pretrained(
22
  MODEL_ID,
23
  torch_dtype=DTYPE,
24
+ use_auth_token=True # For authenticated access to model
25
  )
26
 
27
  if DEVICE == "cuda":
requirements.txt CHANGED
@@ -10,5 +10,3 @@ einops==0.6.1
10
  pytorch-lightning==1.9.0
11
  omegaconf==2.3.0
12
  huggingface-hub>=0.19
13
- xformers==0.0.13
14
- triton==2.0.0
 
10
  pytorch-lightning==1.9.0
11
  omegaconf==2.3.0
12
  huggingface-hub>=0.19