Spaces:
Sleeping
Sleeping
Commit
·
b805b58
1
Parent(s):
d12db4f
Update app.py
Browse files
app.py
CHANGED
@@ -35,9 +35,9 @@ if mps_available:
|
|
35 |
torch_device = "cpu"
|
36 |
torch_dtype = torch.float32
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
|
42 |
if SAFETY_CHECKER == "True":
|
43 |
i2i_pipe = AutoPipelineForImage2Image.from_pretrained(
|
@@ -45,14 +45,14 @@ if SAFETY_CHECKER == "True":
|
|
45 |
torch_dtype=torch_dtype,
|
46 |
variant="fp16" if torch_dtype == torch.float16 else "fp32",
|
47 |
)
|
48 |
-
t2i_pipe = AutoPipelineForText2Image.from_pretrained(
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
)
|
56 |
else:
|
57 |
i2i_pipe = AutoPipelineForImage2Image.from_pretrained(
|
58 |
"stabilityai/sdxl-turbo",
|
@@ -60,17 +60,17 @@ else:
|
|
60 |
torch_dtype=torch_dtype,
|
61 |
variant="fp16" if torch_dtype == torch.float16 else "fp32",
|
62 |
)
|
63 |
-
t2i_pipe = AutoPipelineForText2Image.from_pretrained(
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
)
|
72 |
-
|
73 |
-
t2i_pipe.load_lora_weights("wanghuging/skin_demo", weight_name="skin_demo.safetensors")
|
74 |
t2i_pipe.to(device=torch_device, dtype=torch_dtype).to(device)
|
75 |
t2i_pipe.set_progress_bar_config(disable=True)
|
76 |
i2i_pipe.to(device=torch_device, dtype=torch_dtype).to(device)
|
|
|
35 |
torch_device = "cpu"
|
36 |
torch_dtype = torch.float32
|
37 |
|
38 |
+
t2i_pipe = StableDiffusionPipeline.from_single_file(
|
39 |
+
"https://huggingface.co/wanghuging/skin_demo/blob/main/skin_demo.safetensors"
|
40 |
+
)
|
41 |
|
42 |
if SAFETY_CHECKER == "True":
|
43 |
i2i_pipe = AutoPipelineForImage2Image.from_pretrained(
|
|
|
45 |
torch_dtype=torch_dtype,
|
46 |
variant="fp16" if torch_dtype == torch.float16 else "fp32",
|
47 |
)
|
48 |
+
# t2i_pipe = AutoPipelineForText2Image.from_pretrained(
|
49 |
+
# #"stabilityai/sdxl-turbo",
|
50 |
+
# # "wanghuging/demo_model",
|
51 |
+
# #"stabilityai/stable-diffusion-xl-base-1.0",
|
52 |
+
# "stabilityai/stable-diffusion-2-1",
|
53 |
+
# torch_dtype=torch_dtype,
|
54 |
+
# variant="fp16" #if torch_dtype == torch.float16 else "fp32",
|
55 |
+
# )
|
56 |
else:
|
57 |
i2i_pipe = AutoPipelineForImage2Image.from_pretrained(
|
58 |
"stabilityai/sdxl-turbo",
|
|
|
60 |
torch_dtype=torch_dtype,
|
61 |
variant="fp16" if torch_dtype == torch.float16 else "fp32",
|
62 |
)
|
63 |
+
# t2i_pipe = AutoPipelineForText2Image.from_pretrained(
|
64 |
+
# #"stabilityai/sdxl-turbo",
|
65 |
+
# # "wanghuging/demo_model",
|
66 |
+
# # "stabilityai/stable-diffusion-xl-base-1.0",
|
67 |
+
# "stabilityai/stable-diffusion-2-1",
|
68 |
+
# safety_checker=None,
|
69 |
+
# torch_dtype=torch_dtype,
|
70 |
+
# variant="fp16" #if torch_dtype == torch.float16 else "fp32",
|
71 |
+
# )
|
72 |
+
|
73 |
+
# t2i_pipe.load_lora_weights("wanghuging/skin_demo", weight_name="skin_demo.safetensors")
|
74 |
t2i_pipe.to(device=torch_device, dtype=torch_dtype).to(device)
|
75 |
t2i_pipe.set_progress_bar_config(disable=True)
|
76 |
i2i_pipe.to(device=torch_device, dtype=torch_dtype).to(device)
|