Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -11,7 +11,7 @@ license: mit
|
|
| 11 |
|
| 12 |
# wode
|
| 13 |
|
| 14 |
-
Free
|
| 15 |
|
| 16 |
-
Default model: `
|
| 17 |
-
Recommended settings on free CPU:
|
|
|
|
| 11 |
|
| 12 |
# wode
|
| 13 |
|
| 14 |
+
Free anime image generation Space.
|
| 15 |
|
| 16 |
+
Default model: `stablediffusionapi/counterfeit-v30`
|
| 17 |
+
Recommended settings on free CPU: 512x768, 16-24 steps, expect slow generations.
|
app.py
CHANGED
|
@@ -6,36 +6,36 @@ import gradio as gr
|
|
| 6 |
import torch
|
| 7 |
from diffusers import AutoPipelineForText2Image
|
| 8 |
|
| 9 |
-
MODEL_ID = os.getenv("MODEL_ID", "
|
| 10 |
DEFAULT_NEGATIVE = os.getenv(
|
| 11 |
"DEFAULT_NEGATIVE",
|
| 12 |
-
"blurry, lowres, worst quality, low quality, bad anatomy",
|
| 13 |
)
|
| 14 |
|
| 15 |
PRESETS = {
|
| 16 |
"🌻 向日葵少女": {
|
| 17 |
"prompt": "1girl, anime style, sunflower field, warm sunlight, soft lighting, detailed face, masterpiece, best quality",
|
| 18 |
"negative": DEFAULT_NEGATIVE,
|
| 19 |
-
"steps":
|
| 20 |
-
"cfg":
|
| 21 |
"width": 512,
|
| 22 |
-
"height":
|
| 23 |
"seed": -1,
|
| 24 |
},
|
| 25 |
"🏙 赛博少女": {
|
| 26 |
"prompt": "1girl, anime style, cyberpunk city, neon lights, night street, glowing signs, dynamic pose, masterpiece",
|
| 27 |
"negative": DEFAULT_NEGATIVE,
|
| 28 |
-
"steps":
|
| 29 |
-
"cfg":
|
| 30 |
"width": 512,
|
| 31 |
-
"height":
|
| 32 |
"seed": -1,
|
| 33 |
},
|
| 34 |
"🌸 樱花和服": {
|
| 35 |
"prompt": "1girl, anime style, kimono, cherry blossoms, spring, elegant pose, soft light, detailed illustration",
|
| 36 |
"negative": DEFAULT_NEGATIVE,
|
| 37 |
-
"steps":
|
| 38 |
-
"cfg":
|
| 39 |
"width": 512,
|
| 40 |
"height": 768,
|
| 41 |
"seed": -1,
|
|
@@ -43,8 +43,8 @@ PRESETS = {
|
|
| 43 |
"⚔️ 幻想剑士": {
|
| 44 |
"prompt": "anime warrior girl, fantasy armor, sword, dramatic lighting, wind, detailed background, masterpiece",
|
| 45 |
"negative": DEFAULT_NEGATIVE,
|
| 46 |
-
"steps":
|
| 47 |
-
"cfg":
|
| 48 |
"width": 512,
|
| 49 |
"height": 768,
|
| 50 |
"seed": -1,
|
|
@@ -126,22 +126,22 @@ def generate(
|
|
| 126 |
|
| 127 |
with gr.Blocks(title="wode") as demo:
|
| 128 |
gr.Markdown(
|
| 129 |
-
f"# wode\n\n免费
|
| 130 |
)
|
| 131 |
with gr.Row():
|
| 132 |
with gr.Column():
|
| 133 |
prompt = gr.Textbox(
|
| 134 |
label="正向提示词",
|
| 135 |
lines=4,
|
| 136 |
-
placeholder="例如:1girl, anime style,
|
| 137 |
)
|
| 138 |
negative_prompt = gr.Textbox(label="反向提示词", lines=2, value=DEFAULT_NEGATIVE)
|
| 139 |
with gr.Row():
|
| 140 |
-
steps = gr.Slider(
|
| 141 |
-
guidance_scale = gr.Slider(
|
| 142 |
with gr.Row():
|
| 143 |
width = gr.Slider(256, 768, value=512, step=64, label="宽度")
|
| 144 |
-
height = gr.Slider(256,
|
| 145 |
seed = gr.Number(label="随机种子(-1 为随机)", value=-1, precision=0)
|
| 146 |
with gr.Row():
|
| 147 |
run = gr.Button("开始生成", variant="primary")
|
|
@@ -174,19 +174,19 @@ with gr.Blocks(title="wode") as demo:
|
|
| 174 |
[
|
| 175 |
PRESETS["🌻 向日葵少女"]["prompt"],
|
| 176 |
DEFAULT_NEGATIVE,
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
512,
|
| 180 |
512,
|
|
|
|
| 181 |
-1,
|
| 182 |
],
|
| 183 |
[
|
| 184 |
PRESETS["🏙 赛博少女"]["prompt"],
|
| 185 |
DEFAULT_NEGATIVE,
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
512,
|
| 189 |
512,
|
|
|
|
| 190 |
-1,
|
| 191 |
],
|
| 192 |
],
|
|
|
|
| 6 |
import torch
|
| 7 |
from diffusers import AutoPipelineForText2Image
|
| 8 |
|
| 9 |
+
MODEL_ID = os.getenv("MODEL_ID", "stablediffusionapi/counterfeit-v30")
|
| 10 |
DEFAULT_NEGATIVE = os.getenv(
|
| 11 |
"DEFAULT_NEGATIVE",
|
| 12 |
+
"blurry, lowres, worst quality, low quality, bad anatomy, watermark, text, extra fingers",
|
| 13 |
)
|
| 14 |
|
| 15 |
PRESETS = {
|
| 16 |
"🌻 向日葵少女": {
|
| 17 |
"prompt": "1girl, anime style, sunflower field, warm sunlight, soft lighting, detailed face, masterpiece, best quality",
|
| 18 |
"negative": DEFAULT_NEGATIVE,
|
| 19 |
+
"steps": 18,
|
| 20 |
+
"cfg": 7.0,
|
| 21 |
"width": 512,
|
| 22 |
+
"height": 768,
|
| 23 |
"seed": -1,
|
| 24 |
},
|
| 25 |
"🏙 赛博少女": {
|
| 26 |
"prompt": "1girl, anime style, cyberpunk city, neon lights, night street, glowing signs, dynamic pose, masterpiece",
|
| 27 |
"negative": DEFAULT_NEGATIVE,
|
| 28 |
+
"steps": 18,
|
| 29 |
+
"cfg": 7.0,
|
| 30 |
"width": 512,
|
| 31 |
+
"height": 768,
|
| 32 |
"seed": -1,
|
| 33 |
},
|
| 34 |
"🌸 樱花和服": {
|
| 35 |
"prompt": "1girl, anime style, kimono, cherry blossoms, spring, elegant pose, soft light, detailed illustration",
|
| 36 |
"negative": DEFAULT_NEGATIVE,
|
| 37 |
+
"steps": 20,
|
| 38 |
+
"cfg": 7.0,
|
| 39 |
"width": 512,
|
| 40 |
"height": 768,
|
| 41 |
"seed": -1,
|
|
|
|
| 43 |
"⚔️ 幻想剑士": {
|
| 44 |
"prompt": "anime warrior girl, fantasy armor, sword, dramatic lighting, wind, detailed background, masterpiece",
|
| 45 |
"negative": DEFAULT_NEGATIVE,
|
| 46 |
+
"steps": 20,
|
| 47 |
+
"cfg": 7.0,
|
| 48 |
"width": 512,
|
| 49 |
"height": 768,
|
| 50 |
"seed": -1,
|
|
|
|
| 126 |
|
| 127 |
with gr.Blocks(title="wode") as demo:
|
| 128 |
gr.Markdown(
|
| 129 |
+
f"# wode\n\n免费档二次元生图(已切到 Counterfeit 路线)\n\n当前模型:`{MODEL_ID}`\n\n建议参数:`512x768`、`16-24 steps`、`CFG 6-8`。\n\n⚠️ 免费 CPU 很慢,首张图等 `1~3 分钟` 都正常。"
|
| 130 |
)
|
| 131 |
with gr.Row():
|
| 132 |
with gr.Column():
|
| 133 |
prompt = gr.Textbox(
|
| 134 |
label="正向提示词",
|
| 135 |
lines=4,
|
| 136 |
+
placeholder="例如:1girl, anime style, detailed face, masterpiece, best quality",
|
| 137 |
)
|
| 138 |
negative_prompt = gr.Textbox(label="反向提示词", lines=2, value=DEFAULT_NEGATIVE)
|
| 139 |
with gr.Row():
|
| 140 |
+
steps = gr.Slider(8, 32, value=20, step=1, label="步数 Steps")
|
| 141 |
+
guidance_scale = gr.Slider(1, 12, value=7.0, step=0.5, label="引导强度 CFG")
|
| 142 |
with gr.Row():
|
| 143 |
width = gr.Slider(256, 768, value=512, step=64, label="宽度")
|
| 144 |
+
height = gr.Slider(256, 1024, value=768, step=64, label="高度")
|
| 145 |
seed = gr.Number(label="随机种子(-1 为随机)", value=-1, precision=0)
|
| 146 |
with gr.Row():
|
| 147 |
run = gr.Button("开始生成", variant="primary")
|
|
|
|
| 174 |
[
|
| 175 |
PRESETS["🌻 向日葵少女"]["prompt"],
|
| 176 |
DEFAULT_NEGATIVE,
|
| 177 |
+
18,
|
| 178 |
+
7.0,
|
|
|
|
| 179 |
512,
|
| 180 |
+
768,
|
| 181 |
-1,
|
| 182 |
],
|
| 183 |
[
|
| 184 |
PRESETS["🏙 赛博少女"]["prompt"],
|
| 185 |
DEFAULT_NEGATIVE,
|
| 186 |
+
18,
|
| 187 |
+
7.0,
|
|
|
|
| 188 |
512,
|
| 189 |
+
768,
|
| 190 |
-1,
|
| 191 |
],
|
| 192 |
],
|