Spaces:
Sleeping
Sleeping
Initialize both pipelines
Browse files
app.py
CHANGED
|
@@ -30,7 +30,17 @@ if torch.cuda.is_available():
|
|
| 30 |
else:
|
| 31 |
device='cpu'
|
| 32 |
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
def greet(name):
|
| 36 |
return "Hello " + name + "!!"
|
|
|
|
| 30 |
else:
|
| 31 |
device='cpu'
|
| 32 |
|
| 33 |
+
# Initialize both pipelines
|
| 34 |
+
vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch.float16)
|
| 35 |
+
#init_pipe = DiffusionPipeline.from_pretrained("SG161222/Realistic_Vision_V5.1_noVAE", torch_dtype=torch.float16)
|
| 36 |
+
controlnet = ControlNetModel.from_pretrained("monster-labs/control_v1p_sd15_qrcode_monster", torch_dtype=torch.float16)#, torch_dtype=torch.float16)
|
| 37 |
+
main_pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
| 38 |
+
BASE_MODEL,
|
| 39 |
+
controlnet=controlnet,
|
| 40 |
+
vae=vae,
|
| 41 |
+
safety_checker=None,
|
| 42 |
+
torch_dtype=torch.float16,
|
| 43 |
+
).to(device)
|
| 44 |
|
| 45 |
def greet(name):
|
| 46 |
return "Hello " + name + "!!"
|