-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combining community pipeline for image generation #7945
Comments
I installed import torch
from diffusers import DiffusionPipeline, ControlNetModel
from diffusers import UniPCMultistepScheduler
controlnet_path = f'path/to/instant/id'
# load IdentityNet
identityNet = ControlNetModel.from_pretrained(controlnet_path, torch_dtype=torch.float16)
pipe = DiffusionPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
custom_pipeline="stable_diffusion_xl_reference",
torch_dtype=torch.float16,
use_safetensors=True,
variant="fp16").to('cuda')
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
pipe_instant = DiffusionPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
custom_pipeline="pipeline_stable_diffusion_xl_instantid",
#vae = pipe.vae, # I tried both witout and with the VAE
text_encoder = pipe.text_encoder,
text_encoder_2 = pipe.text_encoder_2,
tokenizer = pipe.tokenizer,
tokenizer_2 = pipe.tokenizer_2,
unet = pipe.unet,
scheduler = pipe.scheduler,
feature_extractor = pipe.feature_extractor,
controlnet = identityNet,
) |
you can create your instant ID pipeline from SDXL reference pipeline with this script import torch
from diffusers import DiffusionPipeline, ControlNetModel
from diffusers import UniPCMultistepScheduler
# load IdentityNet
identityNet = ControlNetModel.from_pretrained("InstantX/InstantID", subfolder ="ControlNetModel", torch_dtype=torch.float16)
pipe = DiffusionPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
custom_pipeline="stable_diffusion_xl_reference",
torch_dtype=torch.float16,
use_safetensors=True,
variant="fp16").to('cuda')
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
pipe_instant = DiffusionPipeline.from_pipe(
pipe,
custom_pipeline="pipeline_stable_diffusion_xl_instantid",
controlnet = identityNet,
) |
@standardAI I did install diffuser from source then I had to downgrade due to an error on instantID. When I generate using both reference and instantId arguments, and with only instant id argument. It does not impact the generation.
And
[note that I use lightning diffuser model] @yiyixuxu since I'm on diffusers==0.26.3 the method from_pipe does not seems to work. |
Describe the bug
I cannot use both stable diffusion XL reference and Instant ID in the same pipeline. I get
'FrozenDict' object has no attribute 'block_out_channels'"
Reproduction
Logs
System Info
diffusers
version: 0.25.0Who can help?
@yiyixuxu @sayakpaul @DN6 @stevhliu
The text was updated successfully, but these errors were encountered: