Commit 0bae87a
committed
feat: Add support for CIVITAI_TOKEN and HF_TOKEN environment variables
Closes #280.
Adds support for the standardized HuggingFace and CivitAI API token environment variables.
This provides a safe and easy way to provide transient secrets without leaking them to disk (nothing gets written to the config).
It also makes it much easier to integrate Comfy-CLI with scripting, since the user no longer has to infinitely provide the "--set-X-token" flags every single time they run the command anymore (which they had to do in the past, just to be sure that the latest token was always used).
The order of priority is `--set-X-token`, then the environment variables (if they exist), and lastly the static config fallback values.
This new feature is now documented in the README and in various error messages.
The code has also been refactored, and the error messages have been improved for clarity and consistency.1 parent d63ce4f commit 0bae87a
3 files changed
Lines changed: 11 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
179 | 181 | | |
180 | 182 | | |
181 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
| 205 | + | |
| 206 | + | |
216 | 207 | | |
217 | 208 | | |
218 | 209 | | |
| |||
281 | 272 | | |
282 | 273 | | |
283 | 274 | | |
284 | | - | |
| 275 | + | |
285 | 276 | | |
286 | 277 | | |
287 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
0 commit comments