Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,7 +31,7 @@ ghibli_style_lora_path = hf_hub_download(repo_id="InstantX/FLUX.1-dev-LoRA-Ghibl
|
|
| 31 |
|
| 32 |
# init InstantCharacter pipeline
|
| 33 |
pipe = InstantCharacterFluxPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
|
| 34 |
-
pipe.to(device)
|
| 35 |
|
| 36 |
# load InstantCharacter
|
| 37 |
pipe.init_adapter(
|
|
@@ -40,6 +40,8 @@ pipe.init_adapter(
|
|
| 40 |
subject_ipadapter_cfg=dict(subject_ip_adapter_path=ip_adapter_path, nb_token=1024),
|
| 41 |
)
|
| 42 |
|
|
|
|
|
|
|
| 43 |
# load matting model
|
| 44 |
birefnet = AutoModelForImageSegmentation.from_pretrained(birefnet_path, trust_remote_code=True)
|
| 45 |
birefnet.to('cuda')
|
|
@@ -302,4 +304,4 @@ with block:
|
|
| 302 |
|
| 303 |
gr.Markdown(article)
|
| 304 |
|
| 305 |
-
block.launch()
|
|
|
|
| 31 |
|
| 32 |
# init InstantCharacter pipeline
|
| 33 |
pipe = InstantCharacterFluxPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
|
| 34 |
+
#pipe.to(device)
|
| 35 |
|
| 36 |
# load InstantCharacter
|
| 37 |
pipe.init_adapter(
|
|
|
|
| 40 |
subject_ipadapter_cfg=dict(subject_ip_adapter_path=ip_adapter_path, nb_token=1024),
|
| 41 |
)
|
| 42 |
|
| 43 |
+
pipe.enable_sequential_cpu_offload()
|
| 44 |
+
|
| 45 |
# load matting model
|
| 46 |
birefnet = AutoModelForImageSegmentation.from_pretrained(birefnet_path, trust_remote_code=True)
|
| 47 |
birefnet.to('cuda')
|
|
|
|
| 304 |
|
| 305 |
gr.Markdown(article)
|
| 306 |
|
| 307 |
+
block.launch(share = True)
|