Documentation
¶
Index ¶
- func AttachAuthHeaders(urlStr string, cfg *config.Config, headers map[string]string) map[string]string
- func New(cfg *config.Config, st *state.DB, version string) tea.Model
- func NormalizeCivitAIURL(raw string) string
- func NormalizeHuggingFaceURL(raw string) string
- func NormalizeURL(raw string) string
- func ResolveAndAttachAuth(ctx context.Context, raw string, cfg *config.Config, ...) (resolvedURL string, headers map[string]string, err error)
- func ResolveWithMeta(ctx context.Context, raw string, cfg *config.Config) (resolvedURL, fileName, suggested, civType string, err error)
- func ResolveWithMetaFull(ctx context.Context, raw string, cfg *config.Config) (*resolver.Resolved, error)
- type Model
- type Theme
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachAuthHeaders ¶ added in v0.6.1
func AttachAuthHeaders(urlStr string, cfg *config.Config, headers map[string]string) map[string]string
AttachAuthHeaders adds authentication headers for known domains. Currently supports Hugging Face and CivitAI tokens from environment.
func NormalizeCivitAIURL ¶ added in v0.6.1
NormalizeCivitAIURL converts civitai.com model page URLs to civitai:// URIs. Example: https://civitai.com/models/12345?modelVersionId=67890
-> civitai://model/12345?version=67890
Returns the normalized URI if the input is a CivitAI model page URL, otherwise returns the original input unchanged.
func NormalizeHuggingFaceURL ¶ added in v0.6.1
NormalizeHuggingFaceURL converts huggingface.co blob URLs to hf:// URIs. Example: https://huggingface.co/owner/repo/blob/main/path/to/file.bin
-> hf://owner/repo/path/to/file.bin?rev=main
Returns the normalized URI if the input is a HF blob URL, otherwise returns the original input unchanged.
func NormalizeURL ¶ added in v0.6.1
NormalizeURL normalizes various URL formats to their URI equivalents. Handles both CivitAI model pages and Hugging Face blob URLs.
func ResolveAndAttachAuth ¶ added in v0.6.1
func ResolveAndAttachAuth(ctx context.Context, raw string, cfg *config.Config, existingHeaders map[string]string) (resolvedURL string, headers map[string]string, err error)
ResolveAndAttachAuth resolves a URL/URI and attaches authentication headers. This is the main function for preparing downloads - it handles: - URL normalization (CivitAI, Hugging Face) - URI resolution (hf://, civitai://) - Authentication header attachment
Returns the resolved URL and headers ready for download.
func ResolveWithMeta ¶ added in v0.6.1
func ResolveWithMeta(ctx context.Context, raw string, cfg *config.Config) (resolvedURL, fileName, suggested, civType string, err error)
ResolveWithMeta resolves a URL/URI using the resolver and returns metadata. Handles hf://, civitai://, and direct HTTP(S) URLs. For CivitAI model page URLs and HF blob URLs, normalizes them first. Returns full Resolved struct for HF quantization support.
func ResolveWithMetaFull ¶ added in v0.6.1
func ResolveWithMetaFull(ctx context.Context, raw string, cfg *config.Config) (*resolver.Resolved, error)
ResolveWithMetaFull resolves a URL/URI and returns the full Resolved struct. This is needed for quantization support where we need AvailableQuantizations.