Commit
·
46e109e
1
Parent(s):
8ef9064
isort pipeline
Browse files- pipeline.py +14 -24
pipeline.py
CHANGED
@@ -1,37 +1,27 @@
|
|
|
|
1 |
from typing import Any, Dict, Optional
|
2 |
-
from diffusers.schedulers import KarrasDiffusionSchedulers
|
3 |
|
|
|
4 |
import numpy
|
|
|
5 |
import torch
|
|
|
6 |
import torch.nn as nn
|
7 |
import torch.utils.checkpoint
|
8 |
-
import torch.distributed
|
9 |
import transformers
|
10 |
-
from
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
from PIL import Image
|
12 |
from torchvision import transforms
|
13 |
-
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
|
14 |
-
from diffusers.utils import BaseOutput
|
15 |
-
|
16 |
-
import rembg
|
17 |
from torchvision.transforms import v2
|
18 |
-
|
19 |
-
import diffusers
|
20 |
-
from diffusers import (
|
21 |
-
AutoencoderKL,
|
22 |
-
DDPMScheduler,
|
23 |
-
DiffusionPipeline,
|
24 |
-
EulerAncestralDiscreteScheduler,
|
25 |
-
UNet2DConditionModel,
|
26 |
-
)
|
27 |
-
from diffusers.image_processor import VaeImageProcessor
|
28 |
-
from diffusers.models.attention_processor import (
|
29 |
-
Attention,
|
30 |
-
AttnProcessor,
|
31 |
-
XFormersAttnProcessor,
|
32 |
-
AttnProcessor2_0,
|
33 |
-
)
|
34 |
-
from diffusers.utils.import_utils import is_xformers_available
|
35 |
|
36 |
|
37 |
def to_rgb_image(maybe_rgba: Image.Image):
|
|
|
1 |
+
from collections import OrderedDict
|
2 |
from typing import Any, Dict, Optional
|
|
|
3 |
|
4 |
+
import diffusers
|
5 |
import numpy
|
6 |
+
import rembg
|
7 |
import torch
|
8 |
+
import torch.distributed
|
9 |
import torch.nn as nn
|
10 |
import torch.utils.checkpoint
|
|
|
11 |
import transformers
|
12 |
+
from diffusers import (AutoencoderKL, DDPMScheduler, DiffusionPipeline,
|
13 |
+
EulerAncestralDiscreteScheduler, UNet2DConditionModel)
|
14 |
+
from diffusers.image_processor import VaeImageProcessor
|
15 |
+
from diffusers.models.attention_processor import (Attention, AttnProcessor,
|
16 |
+
AttnProcessor2_0,
|
17 |
+
XFormersAttnProcessor)
|
18 |
+
from diffusers.schedulers import KarrasDiffusionSchedulers
|
19 |
+
from diffusers.utils import BaseOutput
|
20 |
+
from diffusers.utils.import_utils import is_xformers_available
|
21 |
from PIL import Image
|
22 |
from torchvision import transforms
|
|
|
|
|
|
|
|
|
23 |
from torchvision.transforms import v2
|
24 |
+
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
|
27 |
def to_rgb_image(maybe_rgba: Image.Image):
|