Spaces:
Running
on
Zero
Running
on
Zero
bugfix
Browse files
app.py
CHANGED
|
@@ -36,7 +36,7 @@ IMAGE_SIZE = 512
|
|
| 36 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 37 |
base_model = "black-forest-labs/FLUX.1-dev"
|
| 38 |
|
| 39 |
-
controlnet_model = 'InstantX/FLUX.1-dev-Controlnet-
|
| 40 |
controlnet = FluxControlNetModel.from_pretrained(controlnet_model, torch_dtype=torch.bfloat16)
|
| 41 |
|
| 42 |
|
|
@@ -158,6 +158,7 @@ def run_flux(
|
|
| 158 |
progress
|
| 159 |
) -> Image.Image:
|
| 160 |
print("Running FLUX...")
|
|
|
|
| 161 |
width, height = resolution_wh
|
| 162 |
if randomize_seed_checkbox:
|
| 163 |
seed_slicer = random.randint(0, MAX_SEED)
|
|
@@ -366,7 +367,7 @@ with gr.Blocks() as demo:
|
|
| 366 |
)
|
| 367 |
|
| 368 |
control_mode = gr.Dropdown(
|
| 369 |
-
[ "canny"
|
| 370 |
)
|
| 371 |
lora_strings_json = gr.Text(label="LoRA Configs (JSON List String)", placeholder='[{"repo": "lora_repo1", "weights": "weights1", "adapter_name": "adapter_name1", "adapter_weight": 1}, {"repo": "lora_repo2", "weights": "weights2", "adapter_name": "adapter_name2", "adapter_weight": 1}]', lines=5)
|
| 372 |
|
|
@@ -427,7 +428,7 @@ with gr.Blocks() as demo:
|
|
| 427 |
minimum=1,
|
| 428 |
maximum=50,
|
| 429 |
step=1,
|
| 430 |
-
value=
|
| 431 |
)
|
| 432 |
|
| 433 |
with gr.Accordion("R2 Settings", open=False):
|
|
|
|
| 36 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 37 |
base_model = "black-forest-labs/FLUX.1-dev"
|
| 38 |
|
| 39 |
+
controlnet_model = 'InstantX/FLUX.1-dev-Controlnet-Canny'
|
| 40 |
controlnet = FluxControlNetModel.from_pretrained(controlnet_model, torch_dtype=torch.bfloat16)
|
| 41 |
|
| 42 |
|
|
|
|
| 158 |
progress
|
| 159 |
) -> Image.Image:
|
| 160 |
print("Running FLUX...")
|
| 161 |
+
pipe.to(device)
|
| 162 |
width, height = resolution_wh
|
| 163 |
if randomize_seed_checkbox:
|
| 164 |
seed_slicer = random.randint(0, MAX_SEED)
|
|
|
|
| 367 |
)
|
| 368 |
|
| 369 |
control_mode = gr.Dropdown(
|
| 370 |
+
[ "canny"], label="Controlnet Model", info="choose controlnet model!", value="canny"
|
| 371 |
)
|
| 372 |
lora_strings_json = gr.Text(label="LoRA Configs (JSON List String)", placeholder='[{"repo": "lora_repo1", "weights": "weights1", "adapter_name": "adapter_name1", "adapter_weight": 1}, {"repo": "lora_repo2", "weights": "weights2", "adapter_name": "adapter_name2", "adapter_weight": 1}]', lines=5)
|
| 373 |
|
|
|
|
| 428 |
minimum=1,
|
| 429 |
maximum=50,
|
| 430 |
step=1,
|
| 431 |
+
value=8,
|
| 432 |
)
|
| 433 |
|
| 434 |
with gr.Accordion("R2 Settings", open=False):
|