joeaa17 commited on
Commit
e7634c7
Β·
verified Β·
1 Parent(s): bcc1430

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -153,7 +153,7 @@ def clamp_size_to_megapixels(w: int, h: int, max_mpx: float = 1.0) -> tuple[int,
153
  return max(64, int(w * r)) // 8 * 8, max(64, int(h * r)) // 8 * 8
154
 
155
  # ──────────────────────────────────────────────────────────────────────────────
156
- # Models (use dtype= and use_safetensors=True to avoid offload_state_dict issue)
157
  # ──────────────────────────────────────────────────────────────────────────────
158
 
159
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
@@ -168,17 +168,17 @@ scheduler = EulerAncestralDiscreteScheduler.from_pretrained(
168
  controlnet_scribble = ControlNetModel.from_pretrained(
169
  "xinsir/controlnet-scribble-sdxl-1.0",
170
  use_safetensors=True,
171
- dtype=DTYPE,
172
  )
173
  controlnet_canny = ControlNetModel.from_pretrained(
174
  "xinsir/controlnet-canny-sdxl-1.0",
175
  use_safetensors=True,
176
- dtype=DTYPE,
177
  )
178
  vae = AutoencoderKL.from_pretrained(
179
  "madebyollin/sdxl-vae-fp16-fix",
180
  use_safetensors=True,
181
- dtype=DTYPE,
182
  )
183
 
184
  pipe_scribble = StableDiffusionXLControlNetPipeline.from_pretrained(
@@ -187,7 +187,7 @@ pipe_scribble = StableDiffusionXLControlNetPipeline.from_pretrained(
187
  vae=vae,
188
  scheduler=scheduler,
189
  use_safetensors=True,
190
- dtype=DTYPE,
191
  )
192
  pipe_canny = StableDiffusionXLControlNetPipeline.from_pretrained(
193
  "stabilityai/stable-diffusion-xl-base-1.0",
@@ -195,7 +195,7 @@ pipe_canny = StableDiffusionXLControlNetPipeline.from_pretrained(
195
  vae=vae,
196
  scheduler=scheduler,
197
  use_safetensors=True,
198
- dtype=DTYPE,
199
  )
200
 
201
  for p in (pipe_scribble, pipe_canny):
 
153
  return max(64, int(w * r)) // 8 * 8, max(64, int(h * r)) // 8 * 8
154
 
155
  # ──────────────────────────────────────────────────────────────────────────────
156
+ # Models (use torch_dtype= and use_safetensors=True)
157
  # ──────────────────────────────────────────────────────────────────────────────
158
 
159
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
 
168
  controlnet_scribble = ControlNetModel.from_pretrained(
169
  "xinsir/controlnet-scribble-sdxl-1.0",
170
  use_safetensors=True,
171
+ torch_dtype=DTYPE,
172
  )
173
  controlnet_canny = ControlNetModel.from_pretrained(
174
  "xinsir/controlnet-canny-sdxl-1.0",
175
  use_safetensors=True,
176
+ torch_dtype=DTYPE,
177
  )
178
  vae = AutoencoderKL.from_pretrained(
179
  "madebyollin/sdxl-vae-fp16-fix",
180
  use_safetensors=True,
181
+ torch_dtype=DTYPE,
182
  )
183
 
184
  pipe_scribble = StableDiffusionXLControlNetPipeline.from_pretrained(
 
187
  vae=vae,
188
  scheduler=scheduler,
189
  use_safetensors=True,
190
+ torch_dtype=DTYPE,
191
  )
192
  pipe_canny = StableDiffusionXLControlNetPipeline.from_pretrained(
193
  "stabilityai/stable-diffusion-xl-base-1.0",
 
195
  vae=vae,
196
  scheduler=scheduler,
197
  use_safetensors=True,
198
+ torch_dtype=DTYPE,
199
  )
200
 
201
  for p in (pipe_scribble, pipe_canny):