Spaces:
Running
on
Zero
Running
on
Zero
Alexander Bagus
commited on
Commit
·
5f6e3f8
1
Parent(s):
6958359
22
Browse files- app.py +14 -5
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -6,6 +6,8 @@ import torch
|
|
| 6 |
# from transformers import AutoProcessor, AutoTokenizer
|
| 7 |
# from diffusers import DiffusionPipeline
|
| 8 |
from diffusers import NewbiePipeline
|
|
|
|
|
|
|
| 9 |
|
| 10 |
from utils.image_utils import rescale_image
|
| 11 |
from utils.prompt_utils import polish_prompt
|
|
@@ -13,11 +15,18 @@ from utils.prompt_utils import polish_prompt
|
|
| 13 |
MODEL_REPO = "NewBie-AI/NewBie-image-Exp0.1"
|
| 14 |
MAX_SEED = np.iinfo(np.int32).max
|
| 15 |
|
| 16 |
-
|
| 17 |
-
MODEL_REPO,
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
# def prepare(prompt, is_polish_prompt):
|
| 23 |
# if not is_polish_prompt: return prompt, False
|
|
|
|
| 6 |
# from transformers import AutoProcessor, AutoTokenizer
|
| 7 |
# from diffusers import DiffusionPipeline
|
| 8 |
from diffusers import NewbiePipeline
|
| 9 |
+
from diffusers.models.transformers.transformer_newbie import NextDiT_3B_GQA_patch2_Adaln_Refiner_WHIT_CLIP
|
| 10 |
+
|
| 11 |
|
| 12 |
from utils.image_utils import rescale_image
|
| 13 |
from utils.prompt_utils import polish_prompt
|
|
|
|
| 15 |
MODEL_REPO = "NewBie-AI/NewBie-image-Exp0.1"
|
| 16 |
MAX_SEED = np.iinfo(np.int32).max
|
| 17 |
|
| 18 |
+
transformer = NextDiT_3B_GQA_patch2_Adaln_Refiner_WHIT_CLIP.from_pretrained(
|
| 19 |
+
MODEL_REPO ,
|
| 20 |
+
subfolder = 'transformer',
|
| 21 |
+
torch_dtype=torch.bfloat16,
|
| 22 |
+
use_safetensors=True
|
| 23 |
+
).to("cuda")
|
| 24 |
+
|
| 25 |
+
# pipe = NewbiePipeline.from_pretrained(
|
| 26 |
+
# MODEL_REPO,
|
| 27 |
+
# torch_dtype=torch.bfloat16,
|
| 28 |
+
# )
|
| 29 |
+
# pipe.to("cuda")
|
| 30 |
|
| 31 |
# def prepare(prompt, is_polish_prompt):
|
| 32 |
# if not is_polish_prompt: return prompt, False
|
requirements.txt
CHANGED
|
@@ -3,4 +3,5 @@ torch
|
|
| 3 |
transformers
|
| 4 |
accelerate
|
| 5 |
spaces
|
|
|
|
| 6 |
git+https://github.com/E-Anlia/diffusers.git@add-newbie-pipeline
|
|
|
|
| 3 |
transformers
|
| 4 |
accelerate
|
| 5 |
spaces
|
| 6 |
+
flash-attn
|
| 7 |
git+https://github.com/E-Anlia/diffusers.git@add-newbie-pipeline
|