Spaces:
Running
on
L40S
Running
on
L40S
update
Browse files- canonicalize/pipeline_canonicalize.py +2 -2
- infer_api.py +1 -0
canonicalize/pipeline_canonicalize.py
CHANGED
@@ -394,8 +394,8 @@ class CanonicalizationPipeline(DiffusionPipeline):
|
|
394 |
batch_size = image.shape[0]
|
395 |
# Define call parameters
|
396 |
batch_size = 1 if isinstance(prompt, str) else len(prompt)
|
397 |
-
|
398 |
-
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
399 |
import sys
|
400 |
print(f"PIPELINE Using device!!!!!!!!!!!!: {device}", file=sys.stderr)
|
401 |
# here `guidance_scale` is defined analog to the guidance weight `w` of equation (2)
|
|
|
394 |
batch_size = image.shape[0]
|
395 |
# Define call parameters
|
396 |
batch_size = 1 if isinstance(prompt, str) else len(prompt)
|
397 |
+
device = self._execution_device
|
398 |
+
# device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
399 |
import sys
|
400 |
print(f"PIPELINE Using device!!!!!!!!!!!!: {device}", file=sys.stderr)
|
401 |
# here `guidance_scale` is defined analog to the guidance weight `w` of equation (2)
|
infer_api.py
CHANGED
@@ -875,6 +875,7 @@ infer_canonicalize_validation_pipeline = CanonicalizationPipeline(
|
|
875 |
infer_canonicalize_validation_pipeline.set_progress_bar_config(disable=True)
|
876 |
|
877 |
|
|
|
878 |
def infer_canonicalize_gen(img_input, seed=0):
|
879 |
if np.array(img_input).shape[-1] == 4 and np.array(img_input)[..., 3].min() == 255:
|
880 |
# convert to RGB
|
|
|
875 |
infer_canonicalize_validation_pipeline.set_progress_bar_config(disable=True)
|
876 |
|
877 |
|
878 |
+
@spaces.GPU
|
879 |
def infer_canonicalize_gen(img_input, seed=0):
|
880 |
if np.array(img_input).shape[-1] == 4 and np.array(img_input)[..., 3].min() == 255:
|
881 |
# convert to RGB
|