Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: newbie-nc-1.0
|
| 4 |
+
license_link: LICENSE.md
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
pipeline_tag: text-to-image
|
| 8 |
+
library_name: diffusers
|
| 9 |
+
tags:
|
| 10 |
+
- newbie
|
| 11 |
+
- newbie_image
|
| 12 |
+
- next-dit
|
| 13 |
+
- lumina2
|
| 14 |
+
- text-to-image
|
| 15 |
+
- transformer
|
| 16 |
+
- image-generation
|
| 17 |
+
- Anime
|
| 18 |
+
base_model:
|
| 19 |
+
- NewBie-AI/NewBie-image-Exp0.1
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
Diffusers version of [NewBie-image-Exp0.1](https://huggingface.co/NewBie-AI/NewBie-image-Exp0.1)
|
| 23 |
+
|
| 24 |
+
Usage:
|
| 25 |
+
|
| 26 |
+
```py
|
| 27 |
+
import torch
|
| 28 |
+
from diffusers import NewbiePipeline
|
| 29 |
+
from transformers import AutoModel
|
| 30 |
+
|
| 31 |
+
device = "cuda"
|
| 32 |
+
model_path = "Disty0/NewBie-image-Exp0.1-Diffusers"
|
| 33 |
+
text_encoder_2 = AutoModel.from_pretrained(model_path, subfolder="text_encoder_2", trust_remote_code=True, torch_dtype=torch.bfloat16)
|
| 34 |
+
pipe = NewbiePipeline.from_pretrained(model_path, text_encoder_2=text_encoder_2, torch_dtype=torch.bfloat16)
|
| 35 |
+
del text_encoder_2
|
| 36 |
+
|
| 37 |
+
# Enable memory optimizations.
|
| 38 |
+
pipe.enable_model_cpu_offload(device=device)
|
| 39 |
+
|
| 40 |
+
prompt = """
|
| 41 |
+
<character_1>
|
| 42 |
+
<n>$character_1$</n>
|
| 43 |
+
<gender>1girl</gender>
|
| 44 |
+
<appearance>chibi, red_eyes, blue_hair, long_hair, hair_between_eyes, head_tilt, tareme, closed_mouth</appearance>
|
| 45 |
+
<clothing>school_uniform, serafuku, white_sailor_collar, white_shirt, short_sleeves, red_neckerchief, bow, blue_skirt, miniskirt, pleated_skirt, blue_hat, mini_hat, thighhighs, grey_thighhighs, black_shoes, mary_janes</clothing>
|
| 46 |
+
<expression>happy, smile</expression>
|
| 47 |
+
<action>standing, holding, holding_briefcase</action>
|
| 48 |
+
<position>center_left</position>
|
| 49 |
+
</character_1>
|
| 50 |
+
|
| 51 |
+
<character_2>
|
| 52 |
+
<n>$character_2$</n>
|
| 53 |
+
<gender>1girl</gender>
|
| 54 |
+
<appearance>chibi, red_eyes, pink_hair, long_hair, very_long_hair, multi-tied_hair, open_mouth</appearance>
|
| 55 |
+
<clothing>school_uniform, serafuku, white_sailor_collar, white_shirt, short_sleeves, red_neckerchief, bow, red_skirt, miniskirt, pleated_skirt, hair_bow, multiple_hair_bows, white_bow, ribbon_trim, ribbon-trimmed_bow, white_thighhighs, black_shoes, mary_janes, bow_legwear, bare_arms</clothing>
|
| 56 |
+
<expression>happy, smile</expression>
|
| 57 |
+
<action>standing, holding, holding_briefcase, waving</action>
|
| 58 |
+
<position>center_right</position>
|
| 59 |
+
</character_2>
|
| 60 |
+
|
| 61 |
+
<general_tags>
|
| 62 |
+
<count>2girls, multiple_girls</count>
|
| 63 |
+
<style>anime_style, digital_art</style>
|
| 64 |
+
<background>white_background, simple_background</background>
|
| 65 |
+
<atmosphere>cheerful</atmosphere>
|
| 66 |
+
<quality>high_resolution, detailed</quality>
|
| 67 |
+
<objects>briefcase</objects>
|
| 68 |
+
<other>alternate_costume</other>
|
| 69 |
+
</general_tags>
|
| 70 |
+
"""
|
| 71 |
+
|
| 72 |
+
negative_prompt = "blurry, worst quality, low quality, deformed hands, bad anatomy, extra limbs, poorly drawn face, mutated, extra eyes, bad proportions"
|
| 73 |
+
|
| 74 |
+
pipe.text_encoder_2 = pipe.text_encoder_2.to(device)
|
| 75 |
+
image = pipe(
|
| 76 |
+
prompt,
|
| 77 |
+
negative_prompt=negative_prompt,
|
| 78 |
+
height=1024,
|
| 79 |
+
width=1024,
|
| 80 |
+
guidance_scale=2.5,
|
| 81 |
+
num_inference_steps=30,
|
| 82 |
+
generator=torch.manual_seed(42),
|
| 83 |
+
).images[0]
|
| 84 |
+
display(image)
|
| 85 |
+
```
|