Spaces:
Running
on
Zero
Running
on
Zero
update app
Browse files
app.py
CHANGED
|
@@ -254,7 +254,6 @@ def flux_pipe_call_that_returns_an_iterable_of_images(
|
|
| 254 |
torch.cuda.empty_cache()
|
| 255 |
yield self.image_processor.postprocess(image, output_type=output_type)[0]
|
| 256 |
|
| 257 |
-
#------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
| 258 |
loras = [
|
| 259 |
#63
|
| 260 |
{
|
|
@@ -1097,11 +1096,9 @@ loras = [
|
|
| 1097 |
"weights": "midjourney-painterly.safetensors",
|
| 1098 |
"trigger_word": "mj painterly"
|
| 1099 |
},
|
| 1100 |
-
|
| 1101 |
]
|
| 1102 |
|
| 1103 |
-
#--------------------------------------------------Model Initialization-----------------------------------------------------------------------------------------#
|
| 1104 |
-
|
| 1105 |
dtype = torch.bfloat16
|
| 1106 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 1107 |
base_model = "black-forest-labs/FLUX.1-dev"
|
|
@@ -1163,7 +1160,7 @@ def update_selection(evt: gr.SelectData, width, height):
|
|
| 1163 |
height,
|
| 1164 |
)
|
| 1165 |
|
| 1166 |
-
@spaces.GPU
|
| 1167 |
def generate_image(prompt_mash, steps, seed, cfg_scale, width, height, lora_scale, progress):
|
| 1168 |
pipe.to("cuda")
|
| 1169 |
generator = torch.Generator(device="cuda").manual_seed(seed)
|
|
@@ -1200,7 +1197,7 @@ def generate_image_to_image(prompt_mash, image_input_path, image_strength, steps
|
|
| 1200 |
).images[0]
|
| 1201 |
return final_image
|
| 1202 |
|
| 1203 |
-
@spaces.GPU
|
| 1204 |
def run_lora(prompt, image_input, image_strength, cfg_scale, steps, selected_index, randomize_seed, seed, width, height, lora_scale, progress=gr.Progress(track_tqdm=True)):
|
| 1205 |
if selected_index is None:
|
| 1206 |
raise gr.Error("You must select a LoRA before proceeding.🧨")
|
|
|
|
| 254 |
torch.cuda.empty_cache()
|
| 255 |
yield self.image_processor.postprocess(image, output_type=output_type)[0]
|
| 256 |
|
|
|
|
| 257 |
loras = [
|
| 258 |
#63
|
| 259 |
{
|
|
|
|
| 1096 |
"weights": "midjourney-painterly.safetensors",
|
| 1097 |
"trigger_word": "mj painterly"
|
| 1098 |
},
|
| 1099 |
+
|
| 1100 |
]
|
| 1101 |
|
|
|
|
|
|
|
| 1102 |
dtype = torch.bfloat16
|
| 1103 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 1104 |
base_model = "black-forest-labs/FLUX.1-dev"
|
|
|
|
| 1160 |
height,
|
| 1161 |
)
|
| 1162 |
|
| 1163 |
+
@spaces.GPU
|
| 1164 |
def generate_image(prompt_mash, steps, seed, cfg_scale, width, height, lora_scale, progress):
|
| 1165 |
pipe.to("cuda")
|
| 1166 |
generator = torch.Generator(device="cuda").manual_seed(seed)
|
|
|
|
| 1197 |
).images[0]
|
| 1198 |
return final_image
|
| 1199 |
|
| 1200 |
+
@spaces.GPU
|
| 1201 |
def run_lora(prompt, image_input, image_strength, cfg_scale, steps, selected_index, randomize_seed, seed, width, height, lora_scale, progress=gr.Progress(track_tqdm=True)):
|
| 1202 |
if selected_index is None:
|
| 1203 |
raise gr.Error("You must select a LoRA before proceeding.🧨")
|