Skip to content

Commit

Permalink
Merge pull request #1 from Visionatrix/sd3-flow
Browse files Browse the repository at this point in the history
added SD3-Medium model/flow
  • Loading branch information
bigcat88 authored Jun 15, 2024
2 parents 4ac8d83 + 5b9cfd4 commit 2b77f94
Show file tree
Hide file tree
Showing 11 changed files with 333 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ This repository is intended only for Workflows - if you want to add a flow, make
The Visionatrix documentation is also stored here to not overload the main repository.

For any problems with Visionatrix or suggestions for improvement, go to the [main repository](https://github.com/Visionatrix/Visionatrix).

- [Documentation](https://visionatrix.github.io/VixFlowsDocs/)
- [Available Flows](https://visionatrix.github.io/VixFlowsDocs/Flows/index.html)
- [Manual Installation](https://visionatrix.github.io/VixFlowsDocs/Installation.html)
- [Command Line Options](https://visionatrix.github.io/VixFlowsDocs/CommandLineOptions.html)
- [Working modes](https://visionatrix.github.io/VixFlowsDocs/WorkingModes.html)
- [Vix Workflows](https://visionatrix.github.io/VixFlowsDocs/VixWorkflows.html)
- [Technical information](https://visionatrix.github.io/VixFlowsDocs/TechnicalInformation.html)
39 changes: 39 additions & 0 deletions docs/Flows/SD3_Medium.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.. _SD3_Medium:

StableDiffusion3-Medium
=======================

Flow using the gated model, requires a HuggingFace token to setup.

*This flow is made more for development and verification that we have successfully added the ability to use gated/closed models.*

.. note::
In the future this Flow will either be modernized or removed when something better appears to replace it based on the feature-tuned SD3, if there are any.

**Supports various aspect ratios.**

Hardware
""""""""

- **Required memory: 12-16 GB**

Time to generate 1 image:

- AMD 7900 XTX: **22.1 sec**
- NVIDIA RTX 3060 (12 GB): **25-32 sec**
- Apple M2 Max: **97 sec**

Examples
""""""""

.. image:: /FlowsResults/SD3_Medium_1.png

Prompt: "*Black kitten with white wings sitting on a blue cloud, cinematic*" | prompt_strength: 5.1 (seed: 6814591)

.. image:: /FlowsResults/SD3_Medium_2.png

Prompt: "*poster, cyborg girl against an alien, black baground, high contrast, high details, cinematic*" | prompt_strength: 5.5 (seed: 2131028)

.. image:: /FlowsResults/SD3_Medium_3.png

Prompt: "*an oil line art painting of the angel impressive neon shadows, warm colors*" | prompt_strength: 4.1 (seed: 1167357)
1 change: 1 addition & 0 deletions docs/Flows/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ Available Flows
ComicuPortrait
MemojiPortrait
SupirUpscaler
SD3_Medium
Binary file added docs/FlowsResults/SD3_Medium_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/FlowsResults/SD3_Medium_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/FlowsResults/SD3_Medium_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions docs/GatedModels.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Gated Models
============

It often happens that the model you are using is not available for download without authentication. These are referred to as `Gated Models <https://huggingface.co/docs/hub/models-gated>`_.

Flows with such models have a separate mark in the Visionatrix UI.

To be able to install such a flow, you need to specify an ``Access Token``

.. note::
Currently, only HuggingFace Access Tokens are supported.

Steps to Access Gated Models:

1. Register on `HuggingFace <https://huggingface.co>`_ if you are not already registered
2. Gain access to the model on your account by going to its page (you can click on the model from Visionatrix UI) and filling out the form
3. Generate an access token in the settings of HuggingFace (click on your icon -> settings -> access tokens)
4. Click on ``Set Permissions`` of the token after generation and select ``Read access to contents of all public gated repos you can access``
5. Go to the Visionatrix settings and enter this access token

Alternatively, you can set an environment variable named ``HF_AUTH_TOKEN`` with the token value, but this requires setting up the environment variable for each worker if you have many of them.

I'm a user and want to connect my own worker to process flows with closed models.
---------------------------------------------------------------------------------

As user's workers cannot receive global access tokens from the server to avoid leaks, you have two options:

1. Download the model yourself and place it in the folder specified in ``models_catalog.json`` under the ``save_path`` key.
2. Set the ``HF_AUTH_TOKEN`` environment variable with your own public access token, and the worker will be able to install flows with gated models.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Here will leave all docs that is not suitable for Readme file.
Installation.rst
CommandLineOptions.rst
WorkingModes.rst
GatedModels.rst
VixWorkflows.rst
TechnicalInformation.rst

Expand Down
135 changes: 135 additions & 0 deletions flows/sd3_medium/flow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"name": "sd3_medium",
"display_name": "StableDiffusion3 Medium",
"description": "Simple one model flow for testing purposes",
"author": "Datou",
"homepage": "https://openart.ai/workflows/datou/sd3-basic-workflow/7Udt2JZ3Mwqf1if9EqWt",
"license": "",
"documentation": "https://visionatrix.github.io/VixFlowsDocs/Flows/SD3_Medium.html",
"tags": ["general"],
"input_params": [
{
"name": "prompt",
"display_name": "Prompt",
"type": "text",
"optional": false,
"comfy_node_id": {
"6": {
"dest_field_name": [
"inputs",
"text"
]
}
}
},
{
"name": "negative_prompt",
"display_name": "Negative Prompt",
"type": "text",
"default": "bad quality, poor quality, doll, disfigured, jpg, toy, bad anatomy, missing limbs, missing fingers, 3d, cgi",
"optional": false,
"advanced": true,
"comfy_node_id": {
"71": {
"dest_field_name": [
"inputs",
"text"
]
}
}
},
{
"name": "aspect_ratio",
"display_name": "Aspect Ratio",
"type": "list",
"optional": true,
"advanced": true,
"default": "1x1 (1024x1024)",
"options": {
"1x1 (1024x1024)": [
1024,
1024
],
"2x3 (832x1216)": [
832,
1216
],
"3x4 (896x1152)": [
896,
1152
],
"5:8 (768x1216)": [
768,
1216
],
"9:16 (768x1344)": [
768,
1344
],
"9:19 (704x1472)": [
704,
1472
],
"9:21 (640x1536)": [
640,
1536
],
"3:2 (1216x832)": [
1216,
832
],
"4:3 (1152x896)": [
1152,
896
],
"8:5 (1216x768)": [
1216,
768
],
"16:9 (1344x768)": [
1344,
768
],
"19:9 (1472x704)": [
1472,
704
],
"21:9 (1536x640)": [
1536,
640
]
},
"comfy_node_id": {
"135": {
"dest_field_name": [
"inputs",
[
"width",
"height"
]
]
}
}
},
{
"name": "prompt_strength",
"display_name": "Prompt strength",
"type": "range",
"optional": true,
"advanced": true,
"default": 4.1,
"min": 4.0,
"max": 7.0,
"step": 0.1,
"comfy_node_id": {
"271": {
"dest_field_name": [
"inputs",
"cfg"
],
"internal_type": "float"
}
}
}
]
}
107 changes: 107 additions & 0 deletions flows/sd3_medium/flow_comfy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"6": {
"inputs": {
"text": "",
"clip": [
"252",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"71": {
"inputs": {
"text": "bad quality, poor quality, doll, disfigured, jpg, toy, bad anatomy, missing limbs, missing fingers, 3d, cgi",
"clip": [
"252",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Negative Prompt)"
}
},
"135": {
"inputs": {
"width": 1024,
"height": 1024,
"batch_size": 1
},
"class_type": "EmptySD3LatentImage",
"_meta": {
"title": "EmptySD3LatentImage"
}
},
"231": {
"inputs": {
"samples": [
"271",
0
],
"vae": [
"252",
2
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE Decode"
}
},
"252": {
"inputs": {
"ckpt_name": "sd3_medium_incl_clips_t5xxlfp16.safetensors"
},
"class_type": "CheckpointLoaderSimple",
"_meta": {
"title": "Load Checkpoint"
}
},
"271": {
"inputs": {
"seed": 71844603528225,
"steps": 28,
"cfg": 4.1,
"sampler_name": "dpmpp_2m",
"scheduler": "sgm_uniform",
"denoise": 1,
"model": [
"252",
0
],
"positive": [
"6",
0
],
"negative": [
"71",
0
],
"latent_image": [
"135",
0
]
},
"class_type": "KSampler",
"_meta": {
"title": "KSampler"
}
},
"273": {
"inputs": {
"filename_prefix": "comfy_",
"images": [
"231",
0
]
},
"class_type": "SaveImage",
"_meta": {
"title": "@Datou"
}
}
}
13 changes: 13 additions & 0 deletions models_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,5 +417,18 @@
"input_name": "^(?!.*(?i:lora)).*"
}
]
},
"SD3-Medium" : {
"save_path": "checkpoints/sd3_medium_incl_clips_t5xxlfp16.safetensors",
"url": "https://huggingface.co/stabilityai/stable-diffusion-3-medium/resolve/main/sd3_medium_incl_clips_t5xxlfp16.safetensors",
"homepage": "https://huggingface.co/stabilityai/stable-diffusion-3-medium",
"hash": "69a950c5d143ce782a7423c532c8a12b75da6a37b0e6f26a322acf4e76208912",
"regexes": [
{
"input_value": "^(?=.*(?i:sd3))(?=.*(?i:medium))(?=.*(?i:fp16)).*",
"input_name": "^(?!.*(?i:lora)).*"
}
],
"gated": true
}
}

0 comments on commit 2b77f94

Please sign in to comment.