Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -141,7 +141,7 @@ class FluxDinoPascalModel(nn.Module):
|
|
| 141 |
for timestep in timestep_data['timesteps']:
|
| 142 |
single_features = timestep_data['features'][timestep]['single_features']
|
| 143 |
multi_timestep_features[timestep] = [
|
| 144 |
-
f.float().permute(0, 2, 1).reshape(1, 3072, patch_h, patch_w) for f in single_features]
|
| 145 |
|
| 146 |
flux_features, alpha_layers = self.hyperfeature_fusion(multi_timestep_features)
|
| 147 |
del multi_timestep_features
|
|
@@ -234,9 +234,9 @@ class FluxDinoDUTSModel(nn.Module):
|
|
| 234 |
val = timestep_data['features'][timestep][key]
|
| 235 |
if isinstance(val, list):
|
| 236 |
timestep_data['features'][timestep][key] = [
|
| 237 |
-
f.float() if isinstance(f, torch.Tensor) else f for f in val]
|
| 238 |
elif isinstance(val, torch.Tensor):
|
| 239 |
-
timestep_data['features'][timestep][key] = val.float()
|
| 240 |
|
| 241 |
dino_features = self.dino_extractor(images)
|
| 242 |
|
|
@@ -332,7 +332,7 @@ class FluxNYUDepthModel(nn.Module):
|
|
| 332 |
for timestep in timestep_data['timesteps']:
|
| 333 |
single_features = timestep_data['features'][timestep]['single_features']
|
| 334 |
multi_timestep_features[timestep] = [
|
| 335 |
-
f.float().permute(0, 2, 1).reshape(1, 3072, patch_h, patch_w) for f in single_features]
|
| 336 |
|
| 337 |
fused_flux_features = self.hyperfeature_fusion(multi_timestep_features)
|
| 338 |
|
|
|
|
| 141 |
for timestep in timestep_data['timesteps']:
|
| 142 |
single_features = timestep_data['features'][timestep]['single_features']
|
| 143 |
multi_timestep_features[timestep] = [
|
| 144 |
+
f.float().to(device).permute(0, 2, 1).reshape(1, 3072, patch_h, patch_w) for f in single_features]
|
| 145 |
|
| 146 |
flux_features, alpha_layers = self.hyperfeature_fusion(multi_timestep_features)
|
| 147 |
del multi_timestep_features
|
|
|
|
| 234 |
val = timestep_data['features'][timestep][key]
|
| 235 |
if isinstance(val, list):
|
| 236 |
timestep_data['features'][timestep][key] = [
|
| 237 |
+
f.float().to(device) if isinstance(f, torch.Tensor) else f for f in val]
|
| 238 |
elif isinstance(val, torch.Tensor):
|
| 239 |
+
timestep_data['features'][timestep][key] = val.float().to(device)
|
| 240 |
|
| 241 |
dino_features = self.dino_extractor(images)
|
| 242 |
|
|
|
|
| 332 |
for timestep in timestep_data['timesteps']:
|
| 333 |
single_features = timestep_data['features'][timestep]['single_features']
|
| 334 |
multi_timestep_features[timestep] = [
|
| 335 |
+
f.float().to(device).permute(0, 2, 1).reshape(1, 3072, patch_h, patch_w) for f in single_features]
|
| 336 |
|
| 337 |
fused_flux_features = self.hyperfeature_fusion(multi_timestep_features)
|
| 338 |
|