Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
195ebe5a
Unverified
Commit
195ebe5a
authored
Sep 08, 2022
by
Patrick von Platen
Committed by
GitHub
Sep 08, 2022
Browse files
Mark in painting experimental (#430)
parent
1e98723e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py
...nes/stable_diffusion/pipeline_stable_diffusion_inpaint.py
+5
-0
No files found.
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py
View file @
195ebe5a
...
@@ -11,10 +11,14 @@ from transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer
...
@@ -11,10 +11,14 @@ from transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer
from
...models
import
AutoencoderKL
,
UNet2DConditionModel
from
...models
import
AutoencoderKL
,
UNet2DConditionModel
from
...pipeline_utils
import
DiffusionPipeline
from
...pipeline_utils
import
DiffusionPipeline
from
...schedulers
import
DDIMScheduler
,
PNDMScheduler
from
...schedulers
import
DDIMScheduler
,
PNDMScheduler
from
...utils
import
logging
from
.
import
StableDiffusionPipelineOutput
from
.
import
StableDiffusionPipelineOutput
from
.safety_checker
import
StableDiffusionSafetyChecker
from
.safety_checker
import
StableDiffusionSafetyChecker
logger
=
logging
.
get_logger
(
__name__
)
def
preprocess_image
(
image
):
def
preprocess_image
(
image
):
w
,
h
=
image
.
size
w
,
h
=
image
.
size
w
,
h
=
map
(
lambda
x
:
x
-
x
%
32
,
(
w
,
h
))
# resize to integer multiple of 32
w
,
h
=
map
(
lambda
x
:
x
-
x
%
32
,
(
w
,
h
))
# resize to integer multiple of 32
...
@@ -78,6 +82,7 @@ class StableDiffusionInpaintPipeline(DiffusionPipeline):
...
@@ -78,6 +82,7 @@ class StableDiffusionInpaintPipeline(DiffusionPipeline):
):
):
super
().
__init__
()
super
().
__init__
()
scheduler
=
scheduler
.
set_format
(
"pt"
)
scheduler
=
scheduler
.
set_format
(
"pt"
)
logger
.
info
(
"`StableDiffusionInpaintPipeline` is experimental and will very likely change in the future."
)
self
.
register_modules
(
self
.
register_modules
(
vae
=
vae
,
vae
=
vae
,
text_encoder
=
text_encoder
,
text_encoder
=
text_encoder
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment