Tolga
commited on
Commit
•
a776847
1
Parent(s):
7948dbf
Update app.py
Browse files
app.py
CHANGED
@@ -24,11 +24,14 @@ ENABLE_CPU_OFFLOAD = os.getenv('ENABLE_CPU_OFFLOAD') == '1'
|
|
24 |
|
25 |
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
|
26 |
if torch.cuda.is_available():
|
|
|
27 |
pipe = DiffusionPipeline.from_pretrained(
|
28 |
-
|
29 |
torch_dtype=torch.float16,
|
30 |
use_safetensors=True,
|
31 |
variant='fp16')
|
|
|
|
|
32 |
refiner = DiffusionPipeline.from_pretrained(
|
33 |
'stabilityai/stable-diffusion-xl-refiner-1.0',
|
34 |
torch_dtype=torch.float16,
|
|
|
24 |
|
25 |
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
|
26 |
if torch.cuda.is_available():
|
27 |
+
model = "stabilityai/stable-diffusion-xl-base-1.0"
|
28 |
pipe = DiffusionPipeline.from_pretrained(
|
29 |
+
model,
|
30 |
torch_dtype=torch.float16,
|
31 |
use_safetensors=True,
|
32 |
variant='fp16')
|
33 |
+
pipe.load_lora_weights("model", weight_name="tk_pytorch_lora_weights.safetensors")
|
34 |
+
|
35 |
refiner = DiffusionPipeline.from_pretrained(
|
36 |
'stabilityai/stable-diffusion-xl-refiner-1.0',
|
37 |
torch_dtype=torch.float16,
|