-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Description
hi!
When I used 1.5 to load the model, I enabled the security check mechanism, uninstalled after using the IP-Adapter, and generated the pipe from the previous pipe, which would throw an error with the security check parameters
diffusers/src/diffusers/loaders/ip_adapter.py
Line 209 in adcbe67
| if hasattr(self, "feature_extractor") and getattr(self, "feature_extractor", None) is not None: |
diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py
Line 250 in adcbe67
| if safety_checker is not None and feature_extractor is None: |
os:
diffusers==0.26.0
this is my code:
import torch
from PIL import Image
from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline
model_path = 'C:\\work\\pythonProject\\aidazuo\\models\\Stable-diffusion\\stable-diffusion-v1-5'
ip_adapter_path = 'C:\\work\\pythonProject\\aidazuo\\models\\IP-Adapter'
ip_img_path = 'C:\\work\\pythonProject\\aidazuo\\jupyter-script\\test-img\\vermeer.png'
pipe = StableDiffusionPipeline.from_pretrained(
model_path,
variant="fp16",
torch_dtype=torch.float16).to("cuda")
pipe.load_ip_adapter(ip_adapter_path, subfolder="models", weight_name="ip-adapter-plus_sd15.bin")
pipe.set_ip_adapter_scale(0.6)
ip_adapter_img = Image.open(ip_img_path)
images = pipe(
prompt='a beautiful girl',
ip_adapter_image=ip_adapter_img,
negative_prompt="",
num_inference_steps=30,
num_images_per_prompt=1,
width=512,
height=512).images
pipe.unload_ip_adapter()
imagePipe = StableDiffusionImg2ImgPipeline(**pipe.components).to("cuda")
images2 = imagePipe(num_inference_steps=30,
image=images[0],
strength=0.5,
prompt='a beautiful girl').images
for img in images2:
print(img)
img.show()
Metadata
Metadata
Assignees
Labels
No labels
