isExtraWithValuePresentInPrompt

fun isExtraWithValuePresentInPrompt(prompt: String, loraAlias: String, type: ExtraType = ExtraType.Lora): Pair<Boolean, String?>(source)

Checks if a specific extra with its value is present in the given prompt.

This function searches for an extra of the specified type and alias within the prompt, and if found, extracts its value.

Return

A Pair where:

  • The first element is a Boolean indicating whether the extra is present (true) or not (false) in the prompt.

  • The second element is a String containing the value of the extra if found, or null if not found.

Parameters

prompt

The input prompt string to search within. It's expected to be a comma or space-separated list of keywords.

loraAlias

The specific alias of the extra to search for in the prompt.

type

The type of extra to check for. Defaults to ExtraType.Lora.