Spaces:
Running on Zero
Running on Zero
gradio workflow app
#1
by akhaliq HF Staff - opened
- README.md +24 -0
- workflow.json +191 -0
README.md
CHANGED
|
@@ -22,6 +22,30 @@ short_description: MOSS-Image text-to-image as a gr.Workflow node canvas.
|
|
| 22 |
|
| 23 |
# MOSS-Image Workflow
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
A [Gradio Workflow](https://www.gradio.app/guides/workflows) (node-canvas) version of the official
|
| 26 |
[OpenMOSS-Team/MOSS-Image](https://huggingface.co/spaces/OpenMOSS-Team/MOSS-Image) demo, built on
|
| 27 |
`gr.Workflow` in gradio 6.30.0, with the App view styled after the MOSS-Image landing page.
|
|
|
|
| 22 |
|
| 23 |
# MOSS-Image Workflow
|
| 24 |
|
| 25 |
+
<p align="center">
|
| 26 |
+
<a href="https://huggingface.co/OpenMOSS-Team/MOSS-Image-Base"><img alt="Hugging Face · MOSS-Image-Base" src="https://img.shields.io/badge/🤗%20Hugging%20Face-MOSS--Image--Base-ffc107?style=flat-square"></a>
|
| 27 |
+
|
| 28 |
+
<a href="https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT"><img alt="Hugging Face · MOSS-Image-SFT" src="https://img.shields.io/badge/🤗%20Hugging%20Face-MOSS--Image--SFT-ffc107?style=flat-square"></a>
|
| 29 |
+
|
| 30 |
+
<a href="https://modelscope.cn/models/openmoss/MOSS-Image-Base"><img alt="ModelScope · MOSS-Image-Base" src="assets/modelscope-base-badge.svg"></a>
|
| 31 |
+
|
| 32 |
+
<a href="https://modelscope.cn/models/openmoss/MOSS-Image-SFT"><img alt="ModelScope · MOSS-Image-SFT" src="assets/modelscope-sft-badge.svg"></a>
|
| 33 |
+
|
| 34 |
+
<a href="https://github.com/OpenMOSS/MOSS-Image"><img alt="GitHub" src="https://img.shields.io/badge/GitHub-Code-181717?style=flat-square&logo=github&logoColor=white"></a>
|
| 35 |
+
|
| 36 |
+
<a href="https://openmoss.github.io/MOSS-Image/"><img alt="Homepage" src="https://img.shields.io/badge/🌐%20Project-Homepage-2563eb?style=flat-square"></a>
|
| 37 |
+
|
| 38 |
+
<a href="https://github.com/OpenMOSS/MOSS-Image/blob/main/paper/MOSS_Image_Technical_Report.pdf"><img alt="Technical Report" src="https://img.shields.io/badge/📄%20Paper-Technical_Report-b31b1b?style=flat-square"></a>
|
| 39 |
+
|
| 40 |
+
<a href="https://x.com/Open_MOSS"><img alt="Follow OpenMOSS on X" src="https://img.shields.io/badge/Follow-OpenMOSS-000000?style=flat-square&logo=x&logoColor=white"></a>
|
| 41 |
+
|
| 42 |
+
<a href="https://qm.qq.com/q/hphM7VhaDu"><img alt="MOSS-Image QQ 交流群:755535143" src="https://img.shields.io/badge/QQ-755535143-12B7F5?style=flat-square&logo=qq&logoColor=white"></a>
|
| 43 |
+
|
| 44 |
+
<a href="https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=7a3m2007-815f-409b-9c3d-a4129f5c058e"><img alt="MOSS-Builders Feishu Community" src="assets/feishu-builders-badge.svg"></a>
|
| 45 |
+
|
| 46 |
+
<a href="https://discord.gg/nXFWEyvbb"><img alt="MOSS-Image Discord Community" src="https://img.shields.io/badge/Discord-Community-5865F2?style=flat-square&logo=discord&logoColor=white"></a>
|
| 47 |
+
</p>
|
| 48 |
+
|
| 49 |
A [Gradio Workflow](https://www.gradio.app/guides/workflows) (node-canvas) version of the official
|
| 50 |
[OpenMOSS-Team/MOSS-Image](https://huggingface.co/spaces/OpenMOSS-Team/MOSS-Image) demo, built on
|
| 51 |
`gr.Workflow` in gradio 6.30.0, with the App view styled after the MOSS-Image landing page.
|
workflow.json
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"schema_version": "2",
|
| 3 |
+
"name": "MOSS-Image Text-to-Image",
|
| 4 |
+
"references": [
|
| 5 |
+
{
|
| 6 |
+
"id": "ref_prompt", "label": "Prompt", "role": "reference", "asset_type": "text",
|
| 7 |
+
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
|
| 8 |
+
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
|
| 9 |
+
"x": 60, "y": 60, "width": 280,
|
| 10 |
+
"data": {"out": "A young anime woman, Kazusa from Blue Archive, stands still at the edge of a crowded Tokyo crosswalk outside a busy train station on a damp, overcast dusk. Her short dark hair with soft magenta inner highlights frames her face, cat ears perked slightly beneath her distinctive glowing pink halo. She wears an oversized charcoal wool coat over a beige knit hoodie, a short pleated black skirt, black crew socks, and scuffed loafers, with a canvas tote bag slung over her shoulder. She holds a wired earphone in one hand as if pausing her music, looking slightly sideways with a quiet, unguarded expression while the evening rush hour flows around her.\n\nIn the immediate foreground, a heavily motion-blurred commuter in a dark coat walks right past the lens, partially framing the edge of the shot and giving it the raw, accidental feel of a candid street photograph. Around and behind Kazusa, a bustling crowd of out-of-focus pedestrians moves across the wet asphalt crosswalk under the muted glow of neon department store signs, traffic signals, and concrete office buildings. The image blends Kazusa’s anime appearance seamlessly into a gritty, photorealistic modern city environment, using natural ambient dusk lighting, shallow depth of field, motion blur on the passing crowd, muted cool tones, and a cinematic sense of stillness amid urban chaos."}
|
| 11 |
+
},
|
| 12 |
+
{
|
| 13 |
+
"id": "ref_negative", "label": "Negative Prompt", "role": "reference", "asset_type": "text",
|
| 14 |
+
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
|
| 15 |
+
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
|
| 16 |
+
"x": 60, "y": 250, "width": 280,
|
| 17 |
+
"data": {"out": "watermark, bad anatomy"}
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"id": "ref_model", "label": "Model (base or sft)", "role": "reference", "asset_type": "text",
|
| 21 |
+
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
|
| 22 |
+
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
|
| 23 |
+
"x": 60, "y": 440, "width": 280,
|
| 24 |
+
"data": {"out": "base"}
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"id": "ref_width", "label": "Width", "role": "reference", "asset_type": "number",
|
| 28 |
+
"inputs": [{"id": "in", "label": "Number", "type": "number"}],
|
| 29 |
+
"outputs": [{"id": "out", "label": "Number", "type": "number"}],
|
| 30 |
+
"x": 400, "y": 60, "width": 200,
|
| 31 |
+
"data": {"out": 1184}
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
"id": "ref_height", "label": "Height", "role": "reference", "asset_type": "number",
|
| 35 |
+
"inputs": [{"id": "in", "label": "Number", "type": "number"}],
|
| 36 |
+
"outputs": [{"id": "out", "label": "Number", "type": "number"}],
|
| 37 |
+
"x": 400, "y": 210, "width": 200,
|
| 38 |
+
"data": {"out": 1776}
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"id": "ref_steps", "label": "Steps", "role": "reference", "asset_type": "number",
|
| 42 |
+
"inputs": [{"id": "in", "label": "Number", "type": "number"}],
|
| 43 |
+
"outputs": [{"id": "out", "label": "Number", "type": "number"}],
|
| 44 |
+
"x": 400, "y": 360, "width": 200,
|
| 45 |
+
"data": {"out": 50}
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"id": "ref_cfg", "label": "CFG", "role": "reference", "asset_type": "number",
|
| 49 |
+
"inputs": [{"id": "in", "label": "Number", "type": "number"}],
|
| 50 |
+
"outputs": [{"id": "out", "label": "Number", "type": "number"}],
|
| 51 |
+
"x": 400, "y": 510, "width": 200,
|
| 52 |
+
"data": {"out": 3}
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
"id": "ref_shift", "label": "Shift", "role": "reference", "asset_type": "number",
|
| 56 |
+
"inputs": [{"id": "in", "label": "Number", "type": "number"}],
|
| 57 |
+
"outputs": [{"id": "out", "label": "Number", "type": "number"}],
|
| 58 |
+
"x": 400, "y": 660, "width": 200,
|
| 59 |
+
"data": {"out": 5}
|
| 60 |
+
},
|
| 61 |
+
{
|
| 62 |
+
"id": "ref_seed", "label": "Seed (-1 = random)", "role": "reference", "asset_type": "number",
|
| 63 |
+
"inputs": [{"id": "in", "label": "Number", "type": "number"}],
|
| 64 |
+
"outputs": [{"id": "out", "label": "Number", "type": "number"}],
|
| 65 |
+
"x": 60, "y": 630, "width": 200,
|
| 66 |
+
"data": {"out": 3537712559}
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"id": "ref_num_images", "label": "Images", "role": "reference", "asset_type": "number",
|
| 70 |
+
"inputs": [{"id": "in", "label": "Number", "type": "number"}],
|
| 71 |
+
"outputs": [{"id": "out", "label": "Number", "type": "number"}],
|
| 72 |
+
"x": 60, "y": 790, "width": 200,
|
| 73 |
+
"data": {"out": 1}
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"id": "ref_max_seq", "label": "Max Text Length", "role": "reference", "asset_type": "number",
|
| 77 |
+
"inputs": [{"id": "in", "label": "Number", "type": "number"}],
|
| 78 |
+
"outputs": [{"id": "out", "label": "Number", "type": "number"}],
|
| 79 |
+
"x": 660, "y": 60, "width": 200,
|
| 80 |
+
"data": {"out": 4096}
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"id": "ref_uncond_skip", "label": "Skip Layers (uncond, empty = off)", "role": "reference", "asset_type": "text",
|
| 84 |
+
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
|
| 85 |
+
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
|
| 86 |
+
"x": 660, "y": 210, "width": 200,
|
| 87 |
+
"data": {"out": "22"}
|
| 88 |
+
},
|
| 89 |
+
{
|
| 90 |
+
"id": "ref_slg_layers", "label": "SLG Layers (empty = off)", "role": "reference", "asset_type": "text",
|
| 91 |
+
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
|
| 92 |
+
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
|
| 93 |
+
"x": 660, "y": 360, "width": 200,
|
| 94 |
+
"data": {"out": ""}
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"id": "ref_slg_scale", "label": "SLG Scale", "role": "reference", "asset_type": "number",
|
| 98 |
+
"inputs": [{"id": "in", "label": "Number", "type": "number"}],
|
| 99 |
+
"outputs": [{"id": "out", "label": "Number", "type": "number"}],
|
| 100 |
+
"x": 660, "y": 510, "width": 200,
|
| 101 |
+
"data": {"out": 0}
|
| 102 |
+
},
|
| 103 |
+
{
|
| 104 |
+
"id": "ref_slg_start", "label": "Skip Start", "role": "reference", "asset_type": "number",
|
| 105 |
+
"inputs": [{"id": "in", "label": "Number", "type": "number"}],
|
| 106 |
+
"outputs": [{"id": "out", "label": "Number", "type": "number"}],
|
| 107 |
+
"x": 660, "y": 660, "width": 200,
|
| 108 |
+
"data": {"out": 0}
|
| 109 |
+
},
|
| 110 |
+
{
|
| 111 |
+
"id": "ref_slg_stop", "label": "Skip Stop", "role": "reference", "asset_type": "number",
|
| 112 |
+
"inputs": [{"id": "in", "label": "Number", "type": "number"}],
|
| 113 |
+
"outputs": [{"id": "out", "label": "Number", "type": "number"}],
|
| 114 |
+
"x": 660, "y": 810, "width": 200,
|
| 115 |
+
"data": {"out": 1}
|
| 116 |
+
},
|
| 117 |
+
{
|
| 118 |
+
"id": "ref_example_image", "label": "Example 007 Result (prefill target)", "role": "reference", "asset_type": "image",
|
| 119 |
+
"inputs": [{"id": "in", "label": "Image", "type": "image"}],
|
| 120 |
+
"outputs": [{"id": "out", "label": "Image", "type": "image"}],
|
| 121 |
+
"x": 1300, "y": 60, "width": 340,
|
| 122 |
+
"data": {"out": {"url": "https://huggingface.co/spaces/OpenMOSS-Team/MOSS-Image/resolve/main/assets/images/007/image.webp", "name": "image.webp", "mime": "image/webp"}}
|
| 123 |
+
}
|
| 124 |
+
],
|
| 125 |
+
"operators": [
|
| 126 |
+
{
|
| 127 |
+
"id": "op_generate", "label": "MOSS-Image Generate", "role": "operator",
|
| 128 |
+
"kind": "fn", "fn": "generate",
|
| 129 |
+
"inputs": [
|
| 130 |
+
{"id": "prompt", "label": "Prompt", "type": "text", "required": true},
|
| 131 |
+
{"id": "negative_prompt", "label": "Negative Prompt", "type": "text", "required": false},
|
| 132 |
+
{"id": "model", "label": "Model", "type": "text", "required": true},
|
| 133 |
+
{"id": "width", "label": "Width", "type": "number", "required": true},
|
| 134 |
+
{"id": "height", "label": "Height", "type": "number", "required": true},
|
| 135 |
+
{"id": "steps", "label": "Steps", "type": "number", "required": true},
|
| 136 |
+
{"id": "cfg", "label": "CFG", "type": "number", "required": true},
|
| 137 |
+
{"id": "shift", "label": "Shift", "type": "number", "required": true},
|
| 138 |
+
{"id": "seed", "label": "Seed", "type": "number", "required": true},
|
| 139 |
+
{"id": "num_images", "label": "Images", "type": "number", "required": true},
|
| 140 |
+
{"id": "max_sequence_length", "label": "Max Text Length", "type": "number", "required": true},
|
| 141 |
+
{"id": "uncond_skip_layers", "label": "Skip Layers", "type": "text", "required": false},
|
| 142 |
+
{"id": "slg_layers", "label": "SLG Layers", "type": "text", "required": false},
|
| 143 |
+
{"id": "slg_scale", "label": "SLG Scale", "type": "number", "required": true},
|
| 144 |
+
{"id": "slg_start", "label": "Skip Start", "type": "number", "required": true},
|
| 145 |
+
{"id": "slg_stop", "label": "Skip Stop", "type": "number", "required": true}
|
| 146 |
+
],
|
| 147 |
+
"outputs": [
|
| 148 |
+
{"id": "out_0", "label": "Images", "type": "gallery"},
|
| 149 |
+
{"id": "out_1", "label": "Status", "type": "text"}
|
| 150 |
+
],
|
| 151 |
+
"x": 940, "y": 380, "width": 280,
|
| 152 |
+
"data": {}
|
| 153 |
+
}
|
| 154 |
+
],
|
| 155 |
+
"subjects": [
|
| 156 |
+
{
|
| 157 |
+
"id": "sub_gallery", "label": "Generated Images", "role": "subject", "asset_type": "gallery",
|
| 158 |
+
"inputs": [{"id": "in", "label": "Images", "type": "gallery"}],
|
| 159 |
+
"outputs": [{"id": "out", "label": "Images", "type": "gallery"}],
|
| 160 |
+
"x": 1300, "y": 380, "width": 340,
|
| 161 |
+
"data": {}
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"id": "sub_status", "label": "Status", "role": "subject", "asset_type": "text",
|
| 165 |
+
"inputs": [{"id": "in", "label": "Status", "type": "text"}],
|
| 166 |
+
"outputs": [{"id": "out", "label": "Status", "type": "text"}],
|
| 167 |
+
"x": 1300, "y": 620, "width": 340,
|
| 168 |
+
"data": {}
|
| 169 |
+
}
|
| 170 |
+
],
|
| 171 |
+
"edges": [
|
| 172 |
+
{"id": "e_prompt", "from_node_id": "ref_prompt", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "prompt", "type": "text"},
|
| 173 |
+
{"id": "e_negative", "from_node_id": "ref_negative", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "negative_prompt", "type": "text"},
|
| 174 |
+
{"id": "e_model", "from_node_id": "ref_model", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "model", "type": "text"},
|
| 175 |
+
{"id": "e_width", "from_node_id": "ref_width", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "width", "type": "number"},
|
| 176 |
+
{"id": "e_height", "from_node_id": "ref_height", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "height", "type": "number"},
|
| 177 |
+
{"id": "e_steps", "from_node_id": "ref_steps", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "steps", "type": "number"},
|
| 178 |
+
{"id": "e_cfg", "from_node_id": "ref_cfg", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "cfg", "type": "number"},
|
| 179 |
+
{"id": "e_shift", "from_node_id": "ref_shift", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "shift", "type": "number"},
|
| 180 |
+
{"id": "e_seed", "from_node_id": "ref_seed", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "seed", "type": "number"},
|
| 181 |
+
{"id": "e_num_images", "from_node_id": "ref_num_images", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "num_images", "type": "number"},
|
| 182 |
+
{"id": "e_max_seq", "from_node_id": "ref_max_seq", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "max_sequence_length", "type": "number"},
|
| 183 |
+
{"id": "e_uncond_skip", "from_node_id": "ref_uncond_skip", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "uncond_skip_layers", "type": "text"},
|
| 184 |
+
{"id": "e_slg_layers", "from_node_id": "ref_slg_layers", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "slg_layers", "type": "text"},
|
| 185 |
+
{"id": "e_slg_scale", "from_node_id": "ref_slg_scale", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "slg_scale", "type": "number"},
|
| 186 |
+
{"id": "e_slg_start", "from_node_id": "ref_slg_start", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "slg_start", "type": "number"},
|
| 187 |
+
{"id": "e_slg_stop", "from_node_id": "ref_slg_stop", "from_port_id": "out", "to_node_id": "op_generate", "to_port_id": "slg_stop", "type": "number"},
|
| 188 |
+
{"id": "e_gallery", "from_node_id": "op_generate", "from_port_id": "out_0", "to_node_id": "sub_gallery", "to_port_id": "in", "type": "gallery"},
|
| 189 |
+
{"id": "e_status", "from_node_id": "op_generate", "from_port_id": "out_1", "to_node_id": "sub_status", "to_port_id": "in", "type": "text"}
|
| 190 |
+
]
|
| 191 |
+
}
|