Spaces:
Paused
Paused
pipeline(
Browse files
latent_consistency_img2img.py
CHANGED
@@ -118,10 +118,19 @@ class LatentConsistencyModelImg2ImgPipeline(DiffusionPipeline):
|
|
118 |
prompt,
|
119 |
padding="max_length",
|
120 |
max_length=self.tokenizer.model_max_length,
|
121 |
-
truncation=
|
122 |
return_tensors="pt",
|
123 |
)
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
untruncated_ids = self.tokenizer(
|
126 |
prompt, padding="longest", return_tensors="pt"
|
127 |
).input_ids
|
|
|
118 |
prompt,
|
119 |
padding="max_length",
|
120 |
max_length=self.tokenizer.model_max_length,
|
121 |
+
truncation=False,
|
122 |
return_tensors="pt",
|
123 |
)
|
124 |
+
negative_prompt = "ugly"
|
125 |
+
negative_ids = pipeline.tokenizer(
|
126 |
+
negative_prompt,
|
127 |
+
truncation=False,
|
128 |
+
padding="max_length",
|
129 |
+
max_length=input_ids.shape[-1],
|
130 |
+
return_tensors="pt"
|
131 |
+
).input_ids.to("cuda")
|
132 |
+
|
133 |
+
text_input_ids = text_inputs.input_ids("cuda")
|
134 |
untruncated_ids = self.tokenizer(
|
135 |
prompt, padding="longest", return_tensors="pt"
|
136 |
).input_ids
|