Skip to content

Commit

Permalink
feat: add flux single file support (#3959)
Browse files Browse the repository at this point in the history
feat: flux pipeline single file

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
  • Loading branch information
sozercan authored Oct 25, 2024
1 parent 5be2d22 commit 07ce0a3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions backend/python/diffusers/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,16 @@ def LoadModel(self, request, context):
use_safetensors=True,
variant=variant)
elif request.PipelineType == "FluxPipeline":
if fromSingleFile:
self.pipe = FluxPipeline.from_single_file(modelFile,
torch_dtype=torchType,
use_safetensors=True)
else:
self.pipe = FluxPipeline.from_pretrained(
request.Model,
torch_dtype=torch.bfloat16)
if request.LowVRAM:
self.pipe.enable_model_cpu_offload()
if request.LowVRAM:
self.pipe.enable_model_cpu_offload()
elif request.PipelineType == "FluxTransformer2DModel":
dtype = torch.bfloat16
# specify from environment or default to "ChuckMcSneed/FLUX.1-dev"
Expand Down

0 comments on commit 07ce0a3

Please sign in to comment.