ds1david commited on
Commit
0fa6c9c
·
1 Parent(s): 8094627

fixing bugs

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -44,8 +44,8 @@ class CustomLogger:
44
  logger = CustomLogger(__name__)
45
 
46
  # ================== CONFIGURAÇÃO FORÇADA ==================
47
- device = "cuda" if torch.cuda.is_available() else "cpu"
48
- torch_dtype = torch.float32 # Forçar float32 universalmente
49
  logger.divider("Configuração Forçada")
50
  logger.success(f"Dispositivo: {device.upper()}")
51
  logger.success(f"Precisão: {str(torch_dtype).replace('torch.', '')}")
@@ -85,7 +85,8 @@ try:
85
  pipe = StableDiffusionXLImg2ImgPipeline.from_pretrained(
86
  "stabilityai/stable-diffusion-xl-base-1.0",
87
  torch_dtype=torch_dtype,
88
- use_safetensors=True
 
89
  ).to(device)
90
 
91
  # LoRA
 
44
  logger = CustomLogger(__name__)
45
 
46
  # ================== CONFIGURAÇÃO FORÇADA ==================
47
+ device = "cpu"
48
+ torch_dtype = torch.float32
49
  logger.divider("Configuração Forçada")
50
  logger.success(f"Dispositivo: {device.upper()}")
51
  logger.success(f"Precisão: {str(torch_dtype).replace('torch.', '')}")
 
85
  pipe = StableDiffusionXLImg2ImgPipeline.from_pretrained(
86
  "stabilityai/stable-diffusion-xl-base-1.0",
87
  torch_dtype=torch_dtype,
88
+ use_safetensors=True,
89
+ variant="fp16" if device == "cuda" else None
90
  ).to(device)
91
 
92
  # LoRA