mirror of https://github.com/vladmandic/automatic
feat(civitai): add url parsing to cli search tool
Extract model ID from civitai.com URLs pasted as the query argument, matching the same behavior added to the main search module.pull/4694/head
parent
e7f2b63814
commit
9cf2ab08a0
|
|
@ -113,6 +113,11 @@ def search_civitai(
|
|||
return []
|
||||
|
||||
t0 = time.time()
|
||||
import re
|
||||
url_match = re.match(r'https?://civitai\.com/models/(\d+)', query.strip())
|
||||
if url_match:
|
||||
query = url_match.group(1)
|
||||
log.info(f'CivitAI: extracted model id={query} from URL')
|
||||
dct = { 'query': query }
|
||||
if len(tag) > 0:
|
||||
dct['tag'] = tag
|
||||
|
|
|
|||
Loading…
Reference in New Issue