Open levoz92 opened 5 months ago
Hi, this is produced because you're using from_single_file
, StableDiffusionInpaintPipeline
and a normal model, you'll need to add num_in_channels=4
pipeline = StableDiffusionInpaintPipeline.from_single_file(
model_path,
torch_dtype=torch.float16,
num_in_channels=4).to("cuda")
You can read more about it in this discussion https://github.com/huggingface/diffusers/discussions/7163#discussioncomment-8661046
Also you're not loading the lora correctly, it should be like this:
pipeline.load_lora_weights(".", weight_name="SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors", adapter_name="film")
@asomoza Getting this error now:
TypeError: StableDiffusionInpaintPipeline.__init__() got an unexpected keyword argument 'tokenizer_2'
This is my updated code:
device = "cuda"
model_path = "weights/realisticStockPhoto_v20.safetensors"
pipe = StableDiffusionInpaintPipeline.from_single_file(
model_path,
torch_dtype=torch.float16,
num_in_channels=4).to("cuda")
pipe.load_lora_weights(".", weight_name="weights/SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors", adapter_name="film")
oh I missed that, you're using a SDXL model, you'll need to use the StableDiffusionXLInpaintPipeline
device = "cuda"
model_path = "weights/realisticStockPhoto_v20.safetensors"
pipe = StableDiffusionXLInpaintPipeline.from_single_file(
model_path,
torch_dtype=torch.float16,
num_in_channels=4).to("cuda")
pipe.load_lora_weights(".", weight_name="weights/SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors", adapter_name="film")
Thanks. It works.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
Describe the bug
Hi.
Here, I am trying to do inpaint using realisticStockPhoto with SDXL_FILM_PHOTOGRAPHY_STYLE LoRA.
I have already tested out this model and LoRA on gradio and very satisfied with the results. However, this is the bug that I am getting:
Where am I going wrong?
Reproduction
The error is suggesting two parameters
low_cpu_mem_usage
andignore_mismatcheD_sizes
. I did use these parameters but it made no difference for the errors.Logs
No response
System Info
Colab
Who can help?
No response