twodgirl / stable-diffusion-3-medium-gguf

huggingface.co
Total runs: 34
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: August 15 2024
text-to-image

Introduction of stable-diffusion-3-medium-gguf

Model Details of stable-diffusion-3-medium-gguf

Stable Diffusion 3 Medium

Distribute SD3 in Q8 file format, but run the model in regular fp16.

Gerganov's gguf scripts have been updated, this is just the result.

Download

Download the t5xxl_fp8_e4m3fn.safetensors from camenduru .

You should have:

sd3_medium.Q8.gguf
t5xxl_fp8_e4m3fn.safetensors
Setup
pip install diffusers numpy safetensors sentencepiece transformers
pip install "gguf @ git+https://github.com/ggerganov/llama.cpp.git@master#subdirectory=gguf-py"
Inference
from diffusers import StableDiffusion3Pipeline, SD3Transformer2DModel
import gguf
from gguf.quants import dequantize
from safetensors.torch import load_file
from transformers import T5Config, T5EncoderModel
import torch


def load_transformer_from_gguf(filepath):
    sd = {}
    reader = gguf.GGUFReader(filepath)
    for item in reader.tensors:
        xs = dequantize(item.data, item.tensor_type)
        tensor = torch.tensor(xs)
        sd[item.name] = tensor.to(dtype=torch.float16)
    config = SD3Transformer2DModel.load_config('./transformer')
    transformer = SD3Transformer2DModel.from_config(config).to(dtype=torch.float16)
    transformer.load_state_dict(sd)
    transformer.eval()

    return transformer

transformer = load_transformer_from_gguf('sd3_medium.Q8.gguf')
# Load T5 encoder in F8_E4M3 format.
# t5_config = T5Config.from_pretrained('text_encoder_3')
# t5 = T5EncoderModel(t5_config).to(dtype=torch.float16)
# t5_sd = load_file('t5xxl_fp8_e4m3fn.safetensors')
# t5.load_state_dict(t5_sd)
# t5.eval()
pipe = StableDiffusion3Pipeline.from_pretrained('stabilityai/stable-diffusion-3-medium-diffusers',
                                                transformer=transformer,
                                                # Either disable the T5 encoder.
                                                text_encoder_3=None,
                                                tokenizer_3=None,
                                                # Or enable it.
                                                # text_encoder_3=t5,
                                                torch_dtype=torch.float16)
pipe.enable_model_cpu_offload()
image = pipe('cat playing piano', num_inference_steps=20).images[0]
image.save('cat.png')
Disclaimer

Use of this code and the copy of documentation requires citation and attribution to the author via a link to their Hugging Face profile in all resulting work.

Runs of twodgirl stable-diffusion-3-medium-gguf on huggingface.co

34
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About stable-diffusion-3-medium-gguf huggingface.co Model

More stable-diffusion-3-medium-gguf license Visit here:

https://choosealicense.com/licenses/stabilityai-nc-research-community (other)

stable-diffusion-3-medium-gguf huggingface.co

stable-diffusion-3-medium-gguf huggingface.co is an AI model on huggingface.co that provides stable-diffusion-3-medium-gguf's model effect (), which can be used instantly with this twodgirl stable-diffusion-3-medium-gguf model. huggingface.co supports a free trial of the stable-diffusion-3-medium-gguf model, and also provides paid use of the stable-diffusion-3-medium-gguf. Support call stable-diffusion-3-medium-gguf model through api, including Node.js, Python, http.

stable-diffusion-3-medium-gguf huggingface.co Url

https://huggingface.co/twodgirl/stable-diffusion-3-medium-gguf

twodgirl stable-diffusion-3-medium-gguf online free

stable-diffusion-3-medium-gguf huggingface.co is an online trial and call api platform, which integrates stable-diffusion-3-medium-gguf's modeling effects, including api services, and provides a free online trial of stable-diffusion-3-medium-gguf, you can try stable-diffusion-3-medium-gguf online for free by clicking the link below.

twodgirl stable-diffusion-3-medium-gguf online free url in huggingface.co:

https://huggingface.co/twodgirl/stable-diffusion-3-medium-gguf

stable-diffusion-3-medium-gguf install

stable-diffusion-3-medium-gguf is an open source model from GitHub that offers a free installation service, and any user can find stable-diffusion-3-medium-gguf on GitHub to install. At the same time, huggingface.co provides the effect of stable-diffusion-3-medium-gguf install, users can directly use stable-diffusion-3-medium-gguf installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

stable-diffusion-3-medium-gguf install url in huggingface.co:

https://huggingface.co/twodgirl/stable-diffusion-3-medium-gguf

Url of stable-diffusion-3-medium-gguf

stable-diffusion-3-medium-gguf huggingface.co Url

Provider of stable-diffusion-3-medium-gguf huggingface.co

twodgirl
ORGANIZATIONS

Other API from twodgirl

huggingface.co

Total runs: 7
Run Growth: 0
Growth Rate: 0.00%
Updated:September 27 2024
huggingface.co

Total runs: 1
Run Growth: 0
Growth Rate: 0.00%
Updated:August 18 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:December 13 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:October 07 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 21 2024