Skip to content

Conversation

@noskill
Copy link
Collaborator

@noskill noskill commented Sep 18, 2023

No description provided.

@noskill noskill requested a review from Necr0x0Der September 18, 2023 09:23
@noskill noskill force-pushed the main branch 2 times, most recently from 1a265ba to a6a2d40 Compare September 18, 2023 09:30
@Necr0x0Der
Copy link
Collaborator

Necr0x0Der commented Sep 22, 2023

Partly works, but doesn't work with .safetensors files (besides prompt2im)

@Necr0x0Der
Copy link
Collaborator

The issue is that when we pass model_type=ControlnetType.stable_diffusion_xl to Cond2ImPipe and use .safetensors at the same time, this piece of code is used

if model_id.endswith('.safetensors'):
        try:
            self.pipe = StableDiffusionPipeline.from_single_file(model_id, **args)
        except TypeError as e:
            pass
        self.pipe = StableDiffusionXLPipeline.from_single_file(model_id, **args)

and StableDiffusionXLPipeline is used. While XL class is used, it is used for a different reason, and a wrong class is used (not control net). Apparently, something wrong with this logic. Maybe, we don't need specifically model_type=ControlnetType.stable_diffusion_xl, which is not taken into account in the base class, but could try introducing generic model_type parameter in the base class constructor.

@noskill noskill force-pushed the main branch 2 times, most recently from c4560d8 to 4c7eb4d Compare September 25, 2023 15:10
allow passing different pipelines to Pipe classes
@noskill
Copy link
Collaborator Author

noskill commented Sep 27, 2023

the code should work after pr in diffusers is merged huggingface/diffusers#5179

@Necr0x0Der
Copy link
Collaborator

Still doesn't work for me, but I'm ok with merging it and raising an issue.

@Necr0x0Der Necr0x0Der merged commit 78db98e into singnet:main Oct 4, 2023
@noskill
Copy link
Collaborator Author

noskill commented Oct 5, 2023

@Necr0x0Der the issue in duffusers was with loading StableDiffusionPipeline from safetensors, not StableDiffusionXL

from diffusers import ControlNetModel, StableDiffusionControlNetPipeline


model_id = "realismEngine/realismEngine_v10.safetensors"
cnet_id = "DionTimmer/controlnet_qrcode-control_v1p_sd15"

cnets = [ControlNetModel.from_pretrained(cnet_id)]
StableDiffusionControlNetPipeline.from_single_file(model_id, controlnet=cnets)

My pr was merged in main branch but not yet in current release from 29.09.2023 available on pypi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants