-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Taited/stable diffusion inpaint #1976
Merged
zengyh1900
merged 9 commits into
open-mmlab:main
from
Taited:taited/stable-diffusion-inpaint
Aug 11, 2023
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
eac8ce5
support stable diffusion inpaint
Taited 35a8fa6
add unit test for stable diffusion inpaint
Taited 1334067
fix unit tests and update model zoo error
Taited bc9f677
fix unit test bug
Taited 78316ce
fix unit test error, add attribute latent_channels for vae
Taited 816a40f
fix lint: add the new config in readme
zengyh1900 e5d31bd
improve docstrings and readme for stable diffusion inpaint
Taited 98714a0
Merge branch 'main' into taited/stable-diffusion-inpaint
zengyh1900 b61a21f
add copyright of HuggingFace Team and markdown code language type
Taited File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
configs/stable_diffusion/stable-diffusion_ddim_denoisingunet-inpaint.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Use DiffuserWrapper! | ||
stable_diffusion_v15_url = 'runwayml/stable-diffusion-inpainting' | ||
unet = dict( | ||
type='UNet2DConditionModel', | ||
subfolder='unet', | ||
from_pretrained=stable_diffusion_v15_url) | ||
vae = dict( | ||
type='AutoencoderKL', | ||
from_pretrained=stable_diffusion_v15_url, | ||
subfolder='vae') | ||
|
||
diffusion_scheduler = dict( | ||
type='EditDDIMScheduler', | ||
variance_type='learned_range', | ||
beta_end=0.012, | ||
beta_schedule='scaled_linear', | ||
beta_start=0.00085, | ||
num_train_timesteps=1000, | ||
set_alpha_to_one=False, | ||
clip_sample=False) | ||
|
||
model = dict( | ||
type='StableDiffusionInpaint', | ||
unet=unet, | ||
vae=vae, | ||
enable_xformers=False, | ||
text_encoder=dict( | ||
type='ClipWrapper', | ||
clip_type='huggingface', | ||
pretrained_model_name_or_path=stable_diffusion_v15_url, | ||
subfolder='text_encoder'), | ||
tokenizer=stable_diffusion_v15_url, | ||
scheduler=diffusion_scheduler, | ||
test_scheduler=diffusion_scheduler) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Copyright (c) OpenMMLab. All rights reserved. | ||
from .stable_diffusion import StableDiffusion | ||
from .stable_diffusion_inpaint import StableDiffusionInpaint | ||
from .vae import AutoencoderKL | ||
|
||
__all__ = ['StableDiffusion', 'AutoencoderKL'] | ||
__all__ = ['StableDiffusion', 'AutoencoderKL', 'StableDiffusionInpaint'] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.