Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -43,14 +43,16 @@ def generate(image: Image.Image, edit_prompt: str):
|
|
43 |
|
44 |
global sampler
|
45 |
if sampler is None:
|
46 |
-
#
|
47 |
-
print("Inicializando o XFluxSampler com a configuração...")
|
48 |
sampler = XFluxSampler(
|
49 |
device=device,
|
50 |
ip_loaded=args.use_ip,
|
51 |
spatial_condition=args.use_spatial_condition,
|
52 |
share_position_embedding=args.share_position_embedding,
|
53 |
-
use_share_weight_referencenet=args.use_share_weight_referencenet
|
|
|
|
|
54 |
)
|
55 |
|
56 |
img = image_resize(image, 544)
|
@@ -59,7 +61,6 @@ def generate(image: Image.Image, edit_prompt: str):
|
|
59 |
img = torch.from_numpy((np.array(img) / 127.5) - 1)
|
60 |
img = img.permute(2, 0, 1).unsqueeze(0).to(device, dtype=dtype)
|
61 |
|
62 |
-
# CORREÇÃO: Passa a imagem de origem se qualquer modo de condicionamento estiver ativo
|
63 |
use_image_conditioning = args.use_spatial_condition or args.use_share_weight_referencenet
|
64 |
|
65 |
result = sampler(
|
|
|
43 |
|
44 |
global sampler
|
45 |
if sampler is None:
|
46 |
+
# A inicialização do sampler agora lê os novos parâmetros do .yaml
|
47 |
+
print("Inicializando o XFluxSampler com a configuração completa...")
|
48 |
sampler = XFluxSampler(
|
49 |
device=device,
|
50 |
ip_loaded=args.use_ip,
|
51 |
spatial_condition=args.use_spatial_condition,
|
52 |
share_position_embedding=args.share_position_embedding,
|
53 |
+
use_share_weight_referencenet=args.use_share_weight_referencenet,
|
54 |
+
double_block_refnet=args.double_block_refnet,
|
55 |
+
single_block_refnet=args.single_block_refnet
|
56 |
)
|
57 |
|
58 |
img = image_resize(image, 544)
|
|
|
61 |
img = torch.from_numpy((np.array(img) / 127.5) - 1)
|
62 |
img = img.permute(2, 0, 1).unsqueeze(0).to(device, dtype=dtype)
|
63 |
|
|
|
64 |
use_image_conditioning = args.use_spatial_condition or args.use_share_weight_referencenet
|
65 |
|
66 |
result = sampler(
|