Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import sys
|
2 |
sys.path.append('../')
|
3 |
|
@@ -31,7 +36,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 |
-
|
35 |
|
36 |
# load InstantCharacter
|
37 |
pipe.init_adapter(
|
@@ -40,7 +45,7 @@ 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)
|
|
|
1 |
+
'''
|
2 |
+
sudo apt-get update && sudo apt-get install git-lfs cbm ffmpeg
|
3 |
+
huggingface-cli login
|
4 |
+
'''
|
5 |
+
|
6 |
import sys
|
7 |
sys.path.append('../')
|
8 |
|
|
|
36 |
|
37 |
# init InstantCharacter pipeline
|
38 |
pipe = InstantCharacterFluxPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
|
39 |
+
pipe.to(device)
|
40 |
|
41 |
# load InstantCharacter
|
42 |
pipe.init_adapter(
|
|
|
45 |
subject_ipadapter_cfg=dict(subject_ip_adapter_path=ip_adapter_path, nb_token=1024),
|
46 |
)
|
47 |
|
48 |
+
#pipe.enable_sequential_cpu_offload()
|
49 |
|
50 |
# load matting model
|
51 |
birefnet = AutoModelForImageSegmentation.from_pretrained(birefnet_path, trust_remote_code=True)
|