Skip to content

chigwell/layerxtr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

LayerXTR

PyPI version License: MIT Downloads LinkedIn

Extract and organize detailed layer information from image editing descriptions.

Overview

LayerXTR enables users to process textual descriptions of image layers and return a structured output listing each layer with its attributes. This tool helps streamline workflows for graphic designers, digital artists, and content creators by automating the extraction of layer details from textual descriptions, making it easier to replicate or modify image compositions programmatically.

Installation

pip install layerxtr

Usage

from layerxtr import layerxtr

user_input = "background: sky, foreground: trees, objects: birds"
response = layerxtr(user_input)
print(response)

Input Parameters

  • user_input: str - the user input text to process
  • llm: Optional[BaseChatModel]: the langchain llm instance to use, if not provided the default ChatLLM7 will be used.
  • api_key: Optional[str]: the api key for llm7, if not provided will use default LLM7 key

Note: This package uses the ChatLLM7 from langchain_llm7 by default. Developers can safely pass their own llm instance if they want to use another LLM, via passing it like layerxtr(user_input, llm=their_llm_instance).

Passing Your Own LLM Instance

For example, to use the openai:

from langchain_openai import ChatOpenAI
from layerxtr import layerxtr

llm = ChatOpenAI()
response = layerxtr(user_input, llm=llm)

or for example to use the anthropic:

from langchain_anthropic import ChatAnthropic
from layerxtr import layerxtr

llm = ChatAnthropic()
response = layerxtr(user_input, llm=llm)

or google:

from langchain_google_genai import ChatGoogleGenerativeAI
from layerxtr import layerxtr

llm = ChatGoogleGenerativeAI()
response = layerxtr(user_input, llm=llm)

If you need higher rate limits for LLM7, you can pass your own api_key via environment variable LLM7_API_KEY or via passing it directly like layerxtr(user_input, api_key="their_api_key"). You can get a free api key by registering at https://token.llm7.io/

Rate Limits

The default rate limits for LLM7 free tier are sufficient for most use cases of this package.

Issues

Find issues and submit new ones: https://github.com/chigwell/layerxtr/issues

Author

Eugene Evstafev hi@euegne.plus