改为CPU推理
Browse files
app.py
CHANGED
@@ -85,7 +85,8 @@ def inference(
|
|
85 |
|
86 |
pipe.scheduler = SAMPLER_MAP[sampler](pipe.scheduler.config)
|
87 |
|
88 |
-
generator = torch.manual_seed(
|
|
|
89 |
|
90 |
if qr_code_content != "" or qrcode_image.size == (1, 1):
|
91 |
#print("Generating QR Code from content")
|
|
|
85 |
|
86 |
pipe.scheduler = SAMPLER_MAP[sampler](pipe.scheduler.config)
|
87 |
|
88 |
+
generator = torch.manual_seed(
|
89 |
+
seed) if seed != -1 else torch.Generator(device="cpu")
|
90 |
|
91 |
if qr_code_content != "" or qrcode_image.size == (1, 1):
|
92 |
#print("Generating QR Code from content")
|