Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,19 +11,11 @@ openpose = OpenposeDetector.from_pretrained('lllyasviel/ControlNet')
|
|
11 |
controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-openpose", torch_dtype=torch.float16)
|
12 |
pipe = StableDiffusionControlNetPipeline.from_pretrained("helkoo/jelaba_2HR", controlnet=controlnet, safety_checker=None, torch_dtype=torch.float16)
|
13 |
|
|
|
14 |
#optimizations
|
15 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
16 |
-
|
17 |
-
#pipe.enable_model_cpu_offload()
|
18 |
-
pipe = pipe.to("cuda")
|
19 |
|
20 |
-
def generate(image,prompt):
|
21 |
-
image = openpose(image)
|
22 |
-
#image = image
|
23 |
-
image = pipe(prompt, image, num_inference_steps=20).images[0]
|
24 |
-
return image
|
25 |
-
|
26 |
-
gr.Interface(fn=generate, inputs=["image","text"], outputs="image").launch(share=True, debug=True)
|
27 |
|
28 |
import numpy as np
|
29 |
import requests
|
@@ -49,4 +41,3 @@ gr.Interface(fn=generate2, inputs=["text",
|
|
49 |
["S", "L", "XL"], label="taille", info="choisie la taille"
|
50 |
),
|
51 |
], outputs="image").launch(share=True, debug=True)
|
52 |
-
|
|
|
11 |
controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-openpose", torch_dtype=torch.float16)
|
12 |
pipe = StableDiffusionControlNetPipeline.from_pretrained("helkoo/jelaba_2HR", controlnet=controlnet, safety_checker=None, torch_dtype=torch.float16)
|
13 |
|
14 |
+
|
15 |
#optimizations
|
16 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
17 |
+
pipe = pipe.to("cpu")
|
|
|
|
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
import numpy as np
|
21 |
import requests
|
|
|
41 |
["S", "L", "XL"], label="taille", info="choisie la taille"
|
42 |
),
|
43 |
], outputs="image").launch(share=True, debug=True)
|
|