Fix FLUX2 Klein runtime pipeline
Browse files
src/nexus_visual_weaver/hf_runtime.py
CHANGED
|
@@ -92,7 +92,7 @@ def generate_flux_image(prompt: str, *, seed: int = 0, width: int = 1024, height
|
|
| 92 |
started = time.perf_counter()
|
| 93 |
try:
|
| 94 |
import torch
|
| 95 |
-
from diffusers import
|
| 96 |
except Exception as exc: # pragma: no cover - depends on Space runtime packages.
|
| 97 |
return HFGenerationResult(
|
| 98 |
status="missing_runtime",
|
|
@@ -125,7 +125,7 @@ def generate_flux_image(prompt: str, *, seed: int = 0, width: int = 1024, height
|
|
| 125 |
for candidate in repo_candidates:
|
| 126 |
try:
|
| 127 |
dtype = torch.bfloat16
|
| 128 |
-
pipe =
|
| 129 |
pipe.enable_model_cpu_offload()
|
| 130 |
generator = torch.Generator(device="cuda").manual_seed(seed)
|
| 131 |
image = pipe(
|
|
|
|
| 92 |
started = time.perf_counter()
|
| 93 |
try:
|
| 94 |
import torch
|
| 95 |
+
from diffusers import Flux2KleinPipeline
|
| 96 |
except Exception as exc: # pragma: no cover - depends on Space runtime packages.
|
| 97 |
return HFGenerationResult(
|
| 98 |
status="missing_runtime",
|
|
|
|
| 125 |
for candidate in repo_candidates:
|
| 126 |
try:
|
| 127 |
dtype = torch.bfloat16
|
| 128 |
+
pipe = Flux2KleinPipeline.from_pretrained(candidate, torch_dtype=dtype, token=token)
|
| 129 |
pipe.enable_model_cpu_offload()
|
| 130 |
generator = torch.Generator(device="cuda").manual_seed(seed)
|
| 131 |
image = pipe(
|