kaeru-shigure
commited on
Commit
•
9fbdb4e
1
Parent(s):
7764246
Update README.md
Browse files
README.md
CHANGED
@@ -7,6 +7,81 @@ license: openrail++
|
|
7 |
inference: false
|
8 |
---
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
# One More Step
|
11 |
|
12 |
One More Step (OMS) module was proposed in [One More Step: A Versatile Plug-and-Play Module for Rectifying Diffusion Schedule Flaws and Enhancing Low-Frequency Controls](https://github.com/mhh0318/OneMoreStep)
|
|
|
7 |
inference: false
|
8 |
---
|
9 |
|
10 |
+
# What is different about this fork from the original (h1t/oms_b_openclip_xl)?
|
11 |
+
|
12 |
+
The code has been modified to work with the current final version (0.27.2) of diffusers.
|
13 |
+
The behavior remains the same. Enjoy.
|
14 |
+
|
15 |
+
<img src="kaeru-dev.png" width="600"/>
|
16 |
+
|
17 |
+
```diff
|
18 |
+
- OMSPipeline.from_pretrained('h1t/oms_b_openclip_xl', ...)
|
19 |
+
+ OMSPipeline.from_pretrained('kaeru-shigure/oms_b_openclip_xl', ...)
|
20 |
+
```
|
21 |
+
|
22 |
+
```diff
|
23 |
+
--- a/diffusers_patch/models/unet_2d_condition_woct.py
|
24 |
+
+++ b/diffusers_patch/models/unet_2d_condition_woct.py
|
25 |
+
@@ -35,7 +35,7 @@ from diffusers.models.embeddings import (
|
26 |
+
Timesteps,
|
27 |
+
)
|
28 |
+
from diffusers.models.modeling_utils import ModelMixin
|
29 |
+
-from diffusers.models.unet_2d_blocks import (
|
30 |
+
+from diffusers.models.unets.unet_2d_blocks import (
|
31 |
+
CrossAttnDownBlock2D,
|
32 |
+
CrossAttnUpBlock2D,
|
33 |
+
DownBlock2D,
|
34 |
+
@@ -159,6 +159,7 @@ class UNet2DConditionWoCTModel(ModelMixin, ConfigMixin, UNet2DConditionLoadersMi
|
35 |
+
conv_out_kernel: int = 3,
|
36 |
+
mid_block_only_cross_attention: Optional[bool] = None,
|
37 |
+
cross_attention_norm: Optional[str] = None,
|
38 |
+
+ subfolder: Optional[str] = None,
|
39 |
+
):
|
40 |
+
super().__init__()
|
41 |
+
```
|
42 |
+
|
43 |
+
```diff
|
44 |
+
--- a/diffusers_patch/pipelines/oms/pipeline_oms.py
|
45 |
+
+++ b/diffusers_patch/pipelines/oms/pipeline_oms.py
|
46 |
+
@@ -8,6 +8,7 @@ from transformers import CLIPTextModel, CLIPTextModelWithProjection, CLIPTokeniz
|
47 |
+
|
48 |
+
from diffusers.loaders import FromSingleFileMixin
|
49 |
+
|
50 |
+
+from huggingface_hub.constants import HF_HUB_CACHE, HF_HUB_OFFLINE
|
51 |
+
from diffusers.utils import (
|
52 |
+
USE_PEFT_BACKEND,
|
53 |
+
deprecate,
|
54 |
+
@@ -17,6 +18,7 @@ from diffusers.utils.torch_utils import randn_tensor
|
55 |
+
from diffusers.pipelines.pipeline_utils import DiffusionPipeline
|
56 |
+
from diffusers.pipelines.pipeline_utils import *
|
57 |
+
from diffusers.pipelines.pipeline_utils import _get_pipeline_class
|
58 |
+
+from diffusers.pipelines.pipeline_loading_utils import *
|
59 |
+
from diffusers.models.modeling_utils import _LOW_CPU_MEM_USAGE_DEFAULT
|
60 |
+
|
61 |
+
from diffusers_patch.models.unet_2d_condition_woct import UNet2DConditionWoCTModel
|
62 |
+
@@ -164,7 +166,8 @@ class OMSPipeline(DiffusionPipeline, FromSingleFileMixin):
|
63 |
+
sd_pipeline: DiffusionPipeline,
|
64 |
+
oms_text_encoder:Optional[Union[CLIPTextModel, SDXLTextEncoder]],
|
65 |
+
oms_tokenizer:Optional[Union[CLIPTokenizer, SDXLTokenizer]],
|
66 |
+
- sd_scheduler = None
|
67 |
+
+ sd_scheduler = None,
|
68 |
+
+ trust_remote_code: bool = False,
|
69 |
+
):
|
70 |
+
# assert sd_pipeline is not None
|
71 |
+
|
72 |
+
@@ -279,7 +282,7 @@ class OMSPipeline(DiffusionPipeline, FromSingleFileMixin):
|
73 |
+
|
74 |
+
@classmethod
|
75 |
+
os.PathLike]], **kwargs):
|
76 |
+
- cache_dir = kwargs.pop("cache_dir", DIFFUSERS_CACHE)
|
77 |
+
+ cache_dir = kwargs.pop("cache_dir", HF_HUB_CACHE)
|
78 |
+
resume_download = kwargs.pop("resume_download", False)
|
79 |
+
force_download = kwargs.pop("force_download", False)
|
80 |
+
proxies = kwargs.pop("proxies", None)
|
81 |
+
```
|
82 |
+
|
83 |
+
-----
|
84 |
+
|
85 |
# One More Step
|
86 |
|
87 |
One More Step (OMS) module was proposed in [One More Step: A Versatile Plug-and-Play Module for Rectifying Diffusion Schedule Flaws and Enhancing Low-Frequency Controls](https://github.com/mhh0318/OneMoreStep)
|