Spaces:
Running
on
Zero
Running
on
Zero
Alexander Bagus
commited on
Commit
·
7d91422
1
Parent(s):
83374d2
22
Browse files- app.py +6 -8
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -6,8 +6,7 @@ import torch
|
|
| 6 |
# from transformers import AutoProcessor, AutoTokenizer
|
| 7 |
# from diffusers import DiffusionPipeline
|
| 8 |
from diffusers import NewbiePipeline
|
| 9 |
-
from
|
| 10 |
-
from diffusers.models.transformers.transformer_newbie import NextDiT_CLIP as nextdit_clip
|
| 11 |
|
| 12 |
|
| 13 |
from utils.image_utils import rescale_image
|
|
@@ -16,12 +15,11 @@ from utils.prompt_utils import polish_prompt
|
|
| 16 |
MODEL_REPO = "NewBie-AI/NewBie-image-Exp0.1"
|
| 17 |
MAX_SEED = np.iinfo(np.int32).max
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
).to("cuda")
|
| 25 |
|
| 26 |
# pipe = NewbiePipeline.from_pretrained(
|
| 27 |
# MODEL_REPO,
|
|
|
|
| 6 |
# from transformers import AutoProcessor, AutoTokenizer
|
| 7 |
# from diffusers import DiffusionPipeline
|
| 8 |
from diffusers import NewbiePipeline
|
| 9 |
+
from transformers import AutoModel
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
from utils.image_utils import rescale_image
|
|
|
|
| 15 |
MODEL_REPO = "NewBie-AI/NewBie-image-Exp0.1"
|
| 16 |
MAX_SEED = np.iinfo(np.int32).max
|
| 17 |
|
| 18 |
+
device = "cuda"
|
| 19 |
+
model_path = "Disty0/NewBie-image-Exp0.1-Diffusers"
|
| 20 |
+
text_encoder_2 = AutoModel.from_pretrained(model_path, subfolder="text_encoder_2", trust_remote_code=True, torch_dtype=torch.bfloat16)
|
| 21 |
+
pipe = NewbiePipeline.from_pretrained(model_path, text_encoder_2=text_encoder_2, torch_dtype=torch.bfloat16)
|
| 22 |
+
del text_encoder_2
|
|
|
|
| 23 |
|
| 24 |
# pipe = NewbiePipeline.from_pretrained(
|
| 25 |
# MODEL_REPO,
|
requirements.txt
CHANGED
|
@@ -4,4 +4,4 @@ transformers
|
|
| 4 |
accelerate
|
| 5 |
spaces
|
| 6 |
flash-attn
|
| 7 |
-
git+https://github.com/
|
|
|
|
| 4 |
accelerate
|
| 5 |
spaces
|
| 6 |
flash-attn
|
| 7 |
+
git+https://github.com/Disty0/diffusers
|