Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ import random
|
|
| 12 |
translator = Translator()
|
| 13 |
|
| 14 |
# Constants
|
| 15 |
-
model = "
|
| 16 |
|
| 17 |
CSS = """
|
| 18 |
.gradio-container {
|
|
@@ -27,8 +27,17 @@ MAX_SEED = np.iinfo(np.int32).max
|
|
| 27 |
|
| 28 |
# Ensure model and scheduler are initialized in GPU-enabled function
|
| 29 |
if torch.cuda.is_available():
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
pipe.to("cuda")
|
|
|
|
|
|
|
| 32 |
|
| 33 |
# Function
|
| 34 |
@spaces.GPU()
|
|
|
|
| 12 |
translator = Translator()
|
| 13 |
|
| 14 |
# Constants
|
| 15 |
+
model = "Freepik/flux.1-lite-8B-alpha"
|
| 16 |
|
| 17 |
CSS = """
|
| 18 |
.gradio-container {
|
|
|
|
| 27 |
|
| 28 |
# Ensure model and scheduler are initialized in GPU-enabled function
|
| 29 |
if torch.cuda.is_available():
|
| 30 |
+
transformer = FluxTransformer2DModel.from_single_file(
|
| 31 |
+
"https://huggingface.co/aixonlab/flux.1-lumiere-alpha/blob/main/lumiere_flux_alpha-fp8.safetensors",
|
| 32 |
+
torch_dtype=torch.bfloat16
|
| 33 |
+
)
|
| 34 |
+
pipe = FluxPipeline.from_pretrained(
|
| 35 |
+
model,
|
| 36 |
+
transformer=transformer,
|
| 37 |
+
torch_dtype=torch.bfloat16)
|
| 38 |
pipe.to("cuda")
|
| 39 |
+
|
| 40 |
+
|
| 41 |
|
| 42 |
# Function
|
| 43 |
@spaces.GPU()
|