Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import spaces
|
2 |
import gradio as gr
|
3 |
-
from diffusers import AutoPipelineForText2Image, AutoPipelineForImage2Image, AutoencoderKL
|
4 |
from diffusers.utils import load_image
|
5 |
import torch
|
6 |
|
@@ -14,6 +14,10 @@ image_pipeline = AutoPipelineForImage2Image.from_pretrained("stabilityai/stable-
|
|
14 |
image_pipeline.load_ip_adapter("h94/IP-Adapter", subfolder="sdxl_models", weight_name="ip-adapter_sdxl.bin")
|
15 |
image_pipeline.set_ip_adapter_scale(0.6)
|
16 |
|
|
|
|
|
|
|
|
|
17 |
@spaces.GPU(enable_queue=True)
|
18 |
def text_to_image(ip, prompt, neg_prompt, width, height, ip_scale, strength, guidance, steps):
|
19 |
text_pipeline.to("cuda")
|
|
|
1 |
import spaces
|
2 |
import gradio as gr
|
3 |
+
from diffusers import AutoPipelineForText2Image, AutoPipelineForImage2Image, AutoPipelineForInpainting, AutoencoderKL
|
4 |
from diffusers.utils import load_image
|
5 |
import torch
|
6 |
|
|
|
14 |
image_pipeline.load_ip_adapter("h94/IP-Adapter", subfolder="sdxl_models", weight_name="ip-adapter_sdxl.bin")
|
15 |
image_pipeline.set_ip_adapter_scale(0.6)
|
16 |
|
17 |
+
inpaint_pipeline = AutoPipelineForInpainting.from_pretrained("diffusers/stable-diffusion-xl-1.0-inpainting-0.1", vae=vae, torch_dtype=torch.float16, variant="fp16", use_safetensors=True).to("cuda")
|
18 |
+
inpaint_pipeline.load_ip_adapter("h94/IP-Adapter", subfolder="sdxl_models", weight_name="ip-adapter_sdxl.bin")
|
19 |
+
inpaint_pipeline.set_ip_adapter_scale(0.6)
|
20 |
+
|
21 |
@spaces.GPU(enable_queue=True)
|
22 |
def text_to_image(ip, prompt, neg_prompt, width, height, ip_scale, strength, guidance, steps):
|
23 |
text_pipeline.to("cuda")
|