Views
No views yet
It's important to note that specific quality degradation can vary from model to model. For instance, with an S model, you can have 0.5% degradation as well.


diffusers import with elastic_models.diffusers:1import torch
2from elastic_models.diffusers import StableDiffusion3Pipeline
3
4model_name = 'stabilityai/stable-diffusion-3.5-large'
5hf_token = ''
6device = torch.device("cuda")
7
8pipeline = StableDiffusion3Pipeline.from_pretrained(
9 model_name,
10 torch_dtype=torch.bfloat16,
11 token=hf_token,
12 mode='S'
13)
14pipeline.to(device)
15
16prompts = ["A cat holding a sign that says hello world"]
17output = pipeline(prompt=prompts)
18
19for prompt, output_image in zip(prompts, output.images):
20 output_image.save((prompt.replace(' ', '_') + '.png'))1pip install thestage
2pip install 'thestage-elastic-models[nvidia]' --extra-index-url https://thestage.jfrog.io/artifactory/api/pypi/pypi-thestage-ai-production/simple
3
4# or for blackwell support
5pip install 'thestage-elastic-models[blackwell]' --extra-index-url https://thestage.jfrog.io/artifactory/api/pypi/pypi-thestage-ai-production/simple
6pip install -U --pre torch --index-url https://download.pytorch.org/whl/nightly/cu128
7pip install -U --pre torchvision --index-url https://download.pytorch.org/whl/nightly/cu128
8
9
10pip install flash_attn==2.7.3 --no-build-isolation
11pip uninstall apexthestage config set --api-token <YOUR_API_TOKEN>| Metric/Model | S | XL | Original |
|---|---|---|---|
| PSNR | 20.78 | 29.13 | inf |
| SSIM | 0.81 | 0.95 | 1.0 |
| GPU/Model | S | XL | Original |
|---|---|---|---|
| H100 | 3.10 | 3.80 | 6.55 |
| B200 | 1.76 | 2.27 | 4.81 |