Update pyproject.toml
Browse files- pyproject.toml +32 -42
pyproject.toml
CHANGED
|
@@ -1,47 +1,37 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
import torch
|
| 5 |
-
import torch._dynamo
|
| 6 |
-
import gc
|
| 7 |
-
import os
|
| 8 |
-
from diffusers import FluxPipeline, AutoencoderKL, AutoencoderTiny
|
| 9 |
-
from PIL.Image import Image
|
| 10 |
-
from pipelines.models import TextToImageRequest
|
| 11 |
-
from torch import Generator
|
| 12 |
-
from diffusers import FluxTransformer2DModel, DiffusionPipeline
|
| 13 |
-
from torchao.quantization import quantize_, int8_weight_only, fpx_weight_only
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
path = os.path.join(HF_HUB_CACHE, "models--RobertML--FLUX.1-schnell-int8wo/snapshots/307e0777d92df966a3c0f99f31a6ee8957a9857a")
|
| 27 |
-
transformer = FluxTransformer2DModel.from_pretrained(path, torch_dtype=torch.bfloat16, use_safetensors=False).to(memory_format=torch.channels_last)
|
| 28 |
-
pipeline = DiffusionPipeline.from_pretrained(ids, revision=Revision, vae=vae, transformer=transformer, text_encoder_2=text_encoder_2, torch_dtype=torch.bfloat16,)
|
| 29 |
-
pipeline.to("cuda")
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
generator = Generator(pipeline.device).manual_seed(request.seed)
|
| 38 |
-
|
| 39 |
-
return pipeline(
|
| 40 |
-
request.prompt,
|
| 41 |
-
generator=generator,
|
| 42 |
-
guidance_scale=0.0,
|
| 43 |
-
num_inference_steps=4,
|
| 44 |
-
max_sequence_length=256,
|
| 45 |
-
height=request.height,
|
| 46 |
-
width=request.width,
|
| 47 |
-
).images[0]
|
|
|
|
| 1 |
+
[build-system]
|
| 2 |
+
requires = ["setuptools >= 75.0"]
|
| 3 |
+
build-backend = "setuptools.build_meta"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
+
[project]
|
| 6 |
+
name = "flux-schnell-edge-inference"
|
| 7 |
+
description = "An edge-maxxing model submission for the 4090 Flux contest"
|
| 8 |
+
requires-python = ">=3.10,<3.13"
|
| 9 |
+
version = "8"
|
| 10 |
+
dependencies = [
|
| 11 |
+
"diffusers==0.31.0",
|
| 12 |
+
"transformers==4.46.2",
|
| 13 |
+
"accelerate==1.1.0",
|
| 14 |
+
"omegaconf==2.3.0",
|
| 15 |
+
"torch==2.5.1",
|
| 16 |
+
"protobuf==5.28.3",
|
| 17 |
+
"sentencepiece==0.2.0",
|
| 18 |
+
"torchao==0.6.1",
|
| 19 |
+
"hf_transfer==0.1.8",
|
| 20 |
+
"edge-maxxing-pipelines @ git+https://github.com/womboai/edge-maxxing@7c760ac54f6052803dadb3ade8ebfc9679a94589#subdirectory=pipelines",
|
| 21 |
+
]
|
| 22 |
|
| 23 |
+
[[tool.edge-maxxing.models]]
|
| 24 |
+
repository = "black-forest-labs/FLUX.1-schnell"
|
| 25 |
+
revision = "741f7c3ce8b383c54771c7003378a50191e9efe9"
|
| 26 |
+
exclude = ["transformer", "text_encoder_2"]
|
| 27 |
|
| 28 |
+
[[tool.edge-maxxing.models]]
|
| 29 |
+
repository = "RobertML/FLUX.1-schnell-int8wo"
|
| 30 |
+
revision = "307e0777d92df966a3c0f99f31a6ee8957a9857a"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
+
[[tool.edge-maxxing.models]]
|
| 33 |
+
repository = "city96/t5-v1_1-xxl-encoder-bf16"
|
| 34 |
+
revision = "1b9c856aadb864af93c1dcdc226c2774fa67bc86"
|
| 35 |
|
| 36 |
+
[project.scripts]
|
| 37 |
+
start_inference = "main:main"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|