Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,7 @@ def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
|
41 |
from diffusers import DiffusionPipeline
|
42 |
|
43 |
base_model = "black-forest-labs/FLUX.1-dev"
|
44 |
-
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=
|
45 |
lora_repo = "strangerzonehf/Flux-Super-Realism-LoRA"
|
46 |
trigger_word = "Super Realism" # Leave blank if no trigger word is needed.
|
47 |
pipe.load_lora_weights(lora_repo)
|
@@ -73,7 +73,7 @@ STYLE_NAMES = list(styles.keys())
|
|
73 |
def apply_style(style_name: str, positive: str) -> str:
|
74 |
return styles.get(style_name, styles[DEFAULT_STYLE_NAME]).replace("{prompt}", positive)
|
75 |
|
76 |
-
@spaces.GPU
|
77 |
def generate_image_flux(
|
78 |
prompt: str,
|
79 |
seed: int = 0,
|
@@ -118,7 +118,7 @@ smol_processor = AutoProcessor.from_pretrained("HuggingFaceTB/SmolVLM2-2.2B-Inst
|
|
118 |
smol_model = AutoModelForImageTextToText.from_pretrained(
|
119 |
"HuggingFaceTB/SmolVLM2-2.2B-Instruct",
|
120 |
_attn_implementation="flash_attention_2",
|
121 |
-
torch_dtype=
|
122 |
).to("cuda:0")
|
123 |
|
124 |
# -------------------------------
|
|
|
41 |
from diffusers import DiffusionPipeline
|
42 |
|
43 |
base_model = "black-forest-labs/FLUX.1-dev"
|
44 |
+
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype="auto")
|
45 |
lora_repo = "strangerzonehf/Flux-Super-Realism-LoRA"
|
46 |
trigger_word = "Super Realism" # Leave blank if no trigger word is needed.
|
47 |
pipe.load_lora_weights(lora_repo)
|
|
|
73 |
def apply_style(style_name: str, positive: str) -> str:
|
74 |
return styles.get(style_name, styles[DEFAULT_STYLE_NAME]).replace("{prompt}", positive)
|
75 |
|
76 |
+
@spaces.GPU
|
77 |
def generate_image_flux(
|
78 |
prompt: str,
|
79 |
seed: int = 0,
|
|
|
118 |
smol_model = AutoModelForImageTextToText.from_pretrained(
|
119 |
"HuggingFaceTB/SmolVLM2-2.2B-Instruct",
|
120 |
_attn_implementation="flash_attention_2",
|
121 |
+
torch_dtype="auto"
|
122 |
).to("cuda:0")
|
123 |
|
124 |
# -------------------------------
|