Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ from diffusers import EulerAncestralDiscreteScheduler, LCMScheduler, DDIMSchedul
|
|
14 |
#EulerAncestralDiscreteScheduler 很不錯chatgpt推薦
|
15 |
|
16 |
|
17 |
-
model_id = "hsuwill000/
|
18 |
|
19 |
#model_id = "spamsoms/LCM-anything-v5-openvino2"
|
20 |
#adapter_id = "latent-consistency/lcm-lora-sdv1-5"
|
@@ -29,8 +29,7 @@ pipe = OVStableDiffusionPipeline.from_pretrained(
|
|
29 |
model_id,
|
30 |
compile = False,
|
31 |
ov_config = {"CACHE_DIR":""},
|
32 |
-
|
33 |
-
torch_dtype=torch.bfloat16, #中
|
34 |
#variant="fp16",
|
35 |
#torch_dtype=torch.IntTensor, #慢,
|
36 |
safety_checker=None,
|
@@ -38,7 +37,7 @@ pipe = OVStableDiffusionPipeline.from_pretrained(
|
|
38 |
)
|
39 |
print(pipe.scheduler.compatibles)
|
40 |
#pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
41 |
-
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
|
42 |
|
43 |
#pipe.load_lora_weights(adapter_id)
|
44 |
#pipe.fuse_lora()
|
@@ -65,8 +64,8 @@ def infer(prompt,negative_prompt):
|
|
65 |
negative_prompt = negative_prompt,
|
66 |
width = WIDTH,
|
67 |
height = HIGH,
|
68 |
-
guidance_scale=
|
69 |
-
num_inference_steps=
|
70 |
num_images_per_prompt=1,
|
71 |
).images[0]
|
72 |
|
|
|
14 |
#EulerAncestralDiscreteScheduler 很不錯chatgpt推薦
|
15 |
|
16 |
|
17 |
+
model_id = "hsuwill000/AbsoluteReality-openvino-8bit"
|
18 |
|
19 |
#model_id = "spamsoms/LCM-anything-v5-openvino2"
|
20 |
#adapter_id = "latent-consistency/lcm-lora-sdv1-5"
|
|
|
29 |
model_id,
|
30 |
compile = False,
|
31 |
ov_config = {"CACHE_DIR":""},
|
32 |
+
torch_dtype=torch.uint8,
|
|
|
33 |
#variant="fp16",
|
34 |
#torch_dtype=torch.IntTensor, #慢,
|
35 |
safety_checker=None,
|
|
|
37 |
)
|
38 |
print(pipe.scheduler.compatibles)
|
39 |
#pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
40 |
+
#pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
|
41 |
|
42 |
#pipe.load_lora_weights(adapter_id)
|
43 |
#pipe.fuse_lora()
|
|
|
64 |
negative_prompt = negative_prompt,
|
65 |
width = WIDTH,
|
66 |
height = HIGH,
|
67 |
+
guidance_scale=1.0,
|
68 |
+
num_inference_steps=6,
|
69 |
num_images_per_prompt=1,
|
70 |
).images[0]
|
71 |
|