Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,13 +18,13 @@ clip_processor = CLIPProcessor.from_pretrained("openai/clip-vit-large-patch14")
|
|
| 18 |
|
| 19 |
if torch.cuda.is_available():
|
| 20 |
torch.cuda.max_memory_allocated(device=device)
|
| 21 |
-
pipe =
|
| 22 |
model_path=model_path,
|
| 23 |
device=device,
|
| 24 |
use_torchcompile=False,
|
| 25 |
)
|
| 26 |
else:
|
| 27 |
-
pipe =
|
| 28 |
model_path=model_path,
|
| 29 |
device=device,
|
| 30 |
apply_optimization=False,
|
|
@@ -65,7 +65,7 @@ def infer(
|
|
| 65 |
sample_mid_interpolation = num_interpolation_steps
|
| 66 |
remove_n_middle = 0
|
| 67 |
|
| 68 |
-
interpolated_prompt_embeds, prompt_metadata =
|
| 69 |
prompts,
|
| 70 |
pipe,
|
| 71 |
num_interpolation_steps,
|
|
@@ -75,7 +75,7 @@ def infer(
|
|
| 75 |
)
|
| 76 |
negative_prompts = [negative_prompt, negative_prompt]
|
| 77 |
if negative_prompts != ["", ""]:
|
| 78 |
-
interpolated_negative_prompts_embeds, _ =
|
| 79 |
negative_prompts,
|
| 80 |
pipe,
|
| 81 |
num_interpolation_steps,
|
|
|
|
| 18 |
|
| 19 |
if torch.cuda.is_available():
|
| 20 |
torch.cuda.max_memory_allocated(device=device)
|
| 21 |
+
pipe = sourcecode.pipe_img(
|
| 22 |
model_path=model_path,
|
| 23 |
device=device,
|
| 24 |
use_torchcompile=False,
|
| 25 |
)
|
| 26 |
else:
|
| 27 |
+
pipe = sourcecode.pipe_img(
|
| 28 |
model_path=model_path,
|
| 29 |
device=device,
|
| 30 |
apply_optimization=False,
|
|
|
|
| 65 |
sample_mid_interpolation = num_interpolation_steps
|
| 66 |
remove_n_middle = 0
|
| 67 |
|
| 68 |
+
interpolated_prompt_embeds, prompt_metadata = sourcecode.interpolatePrompts(
|
| 69 |
prompts,
|
| 70 |
pipe,
|
| 71 |
num_interpolation_steps,
|
|
|
|
| 75 |
)
|
| 76 |
negative_prompts = [negative_prompt, negative_prompt]
|
| 77 |
if negative_prompts != ["", ""]:
|
| 78 |
+
interpolated_negative_prompts_embeds, _ = sourcecode.interpolatePrompts(
|
| 79 |
negative_prompts,
|
| 80 |
pipe,
|
| 81 |
num_interpolation_steps,
|