-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
Support for runwayml In-painting SD model. #3140
Support for runwayml In-painting SD model. #3140
Conversation
edit attention key handler: return early when weight parse returns NaN
The directory for the images saved with the Save button may still not exist, so it needs to be created prior to opening the log.csv file.
Add "Scale to" option to Extras
remake train interface to use tabs
Add option to store TI embeddings in png chunks, and load from same.
train: make it possible to make text files with prompts train: rework scheduler so that there's less repeating code in textual inversion and hypernets train: move epochs setting to options
deepbooru: added option to quote (\) in tags deepbooru/BLIP: write caption to file instead of image filename deepbooru/BLIP: now possible to use both for captions deepbooru: process is stopped even if an exception occurs
…de_ranks_in_output
Yes, I observe matching seed parity with the CompVis stable-diffusion repo. The only code path that the visual conditing is used in is the new
Ideally the config should not need to be changed. I Originally misattributed the bug.
It provides the network with contextual information about the original image. Presumably this allows it to better fine-tune the in-painting, creating a more coherent image. |
@random-thoughtss You can do |
I'm in randomthoughtss branch, monkeypatched caveat; torch1.12.1+rocm5.1, bur it usually doesn't matter.
|
That’s most likely due to our repo using the CompVis config. Try also adding: |
I think this model could also be used for outpainting with great effect. |
Vanilla
|
Change |
I give up for now. Non-programmer trashing up the collabo isn't going to do any good. |
Actually, that shouldn't happen. @random-thoughtss When you tested 1.4, did you change the model dimensions to match 1.4 inside the config? We shouldn't break compatibility with 1.4, as 1.5 (which will release very soon now) uses the same dimensions. |
@AUTOMATIC1111 Curious to hear your thoughts on this model. My thinking is like this: |
This is all that's needed to load it as-is. I've had better results outpainting with this model than inpainting but probably a skill issue. (hilariously poor man's outpainting seems to work better than mk2 with this model) We also don't need to switch to the RunwayML repo for this. We can continue our proud tradition of hijacking the CompVis repo. I wrote some working code performing just that. |
oxy: switching to different repo is a big step, I need to grab his branch and check if it really is a lot better, then there can be some considerations. |
also is the sd 1.5 the finetuned 1.5 model that emad keeps from being released? |
We don’t need to switch repos. I wrote working hijacking code for this. 1.5 is (much like 1.4) just 1.2 but further along training. 1.4 is resumed from 1.2 and trained for ~270k steps I think, and 1.5 ~600k
yes
sd_models.py
|
Since you researched it, do you mind writing a paragraph or so about what it does differenty, apart from using a new model? |
I haven't researched this model very long. As far as I can see, it adds 5(1+4) new input channels for inpainting and finetunes for that. Personally, I think it's a big improvement for outpainting, at least. Oh, do you mean the code? |
I should have probably mentioned that the original config for the in-painting model was not released alongside the checkpoint but can be found here. This config works with the current repo, with the additional
These manual changes by @C43H66N12O12S2 replicate all of the changes RunwayML made do their config. Would it be better to
|
This reverts commit c6f4a873d7c8a916814e3201044b84b72e09769a.
Just a sidenote, reload_model_weights needs to be modified as well, or switching won't work if the initial model is a "normal" model. The easiest - if not elegant - way to achieve that would be Actually, the reverse will fail as well (switching from runway to any other model with 4 channels) Also, we should add credit to the RunwayML repo in sd_hijack_loading.py Aside from those minor adjustments, this PR is close to ready. Just need to support vanilla samplers. Seems to not work with txt2img hires fix, but that’s not the usecase for this model anyways. |
Hmm... if I checkout c6f4a873d7c8a916814e3201044b84b72e09769a and save https://raw.githubusercontent.com/runwayml/stable-diffusion/main/configs/stable-diffusion/v1-inpainting-inference.yaml (with additional use_ema:false parameter) as {models}/sd-v1-5-inpainting.yaml I get the error
Were there other changes needed to get this working? |
Why was this closed? Is there another version in the works? |
bump, we need this outpainting quality, it's crazy good |
Because the merge was totally botched. This needs a deep cleanup. |
Follow #3192 for the proper PR. |
Yup, this repo got messed up. The new PR continues the work. @AUTOMATIC1111 Github support says they can remove the dead commits from the pr and keep the discussion if you permit it. |
A simple addition to support the new in-painting model released here:
https://github.com/runwayml/stable-diffusion
We update the
stable-diffusion
dependency to point to the new repo and pass in the required additional features to the model. It requires an extramasked-image
andmask
inputs which act as visual conditioning for the model. Setting the mask to be all 1s can also be used for txt2img generation.Implemented
TODO
VanillaStableDiffusionSampler
updatesuse_ema: False
config option. Currently need to adduse_ema: False
insd-v1-5-inpainting.yaml
, otherwise the checkpoint will not load.