view flux.xml @ 0:0d0561746128 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/flux commit 71b3dacee16dc999cb4fa113858d6ace1781c71c
author bgruening
date Mon, 14 Oct 2024 16:50:38 +0000
parents
children 7933bed1ffab
line wrap: on
line source

<tool id="black_forest_labs_flux" name="FLUX" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.0">
    <description>text-to-image model</description>
    <macros>
        <token name="@TOOL_VERSION@">2024</token>
        <token name="@VERSION_SUFFIX@">0</token>
    </macros>
    <requirements>
        <requirement type="package" version="3.12">python</requirement>
        <requirement type="package" version="2.4.1">pytorch</requirement>
        <requirement type="package" version="0.19.1">torchvision</requirement>
        <requirement type="package" version="0.30.2">diffusers</requirement>
        <requirement type="package" version="4.44.2">transformers</requirement>
        <requirement type="package" version="0.34.0">accelerate</requirement>
        <requirement type="package" version="0.2.0">sentencepiece</requirement>
        <requirement type="package" version="4.25.3">protobuf</requirement>
        <requirement type="package" version="0.24.6">huggingface_hub</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
export HF_HOME='$flux_models.fields.path' &&
python '$__tool_directory__/flux.py'
'$flux_models'
'$input_type_selector'
'$prompt'
    ]]></command>
    <configfiles>
    </configfiles>
    <inputs>
        <param name="flux_models" label="Model data" type="select" help="contact the administrator of this Galaxy instance if you miss model data">
            <options from_data_table="huggingface">
                <filter type="static_value" column="4" value="flux"/>
                <filter type="static_value" column="5" value="1"/>
            </options>
            <validator message="No model annotation is available for FLUX" type="no_options"/>
        </param>
        <conditional name="input_type">
            <param name="input_type_selector" type="select" label="Choose the type of input">
                <option value="file" selected="true">File based input</option>
                <option value="text">Text based input</option>
            </param>
            <when value="file">
                <param name="prompt" type="data" optional="false" format="txt" label="Prompt file" help="This data will be used as prompt"/>
            </when>
            <when value="text">
                <param name="prompt" type="text" optional="false" label="Prompt" help="This text will be used as prompt" area="true">
                    <validator type="empty_field"/>
                </param>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data name="output" format="png" label="${tool.name} on ${on_string}" from_work_dir="./output.png"/>
    </outputs>
    <tests>
        <test expect_exit_code="1" expect_failure="true">
            <param name="flux_models" value="unknown"/>
            <param name="input_type_selector" value="file"/>
            <param name="prompt" value="flux_test.txt"/>
            <assert_stdout>
                <has_text text="Invalid model!"/>
            </assert_stdout>
        </test>
    </tests>
    <help><![CDATA[

.. class:: infomark

**What it does**

FLUX is a text-to-image model that generates images from textual descriptions.

Usage
.....

**Input**

1. **Model data**:
    Select the model data from the dropdown list. The available models are dev and schnell.
    For using dev model, make sure to not use it for commercial purposes.

2. **Input Prompt**: You can provide the input prompt in two ways:
    - **File based input**: Upload a txt file containing the prompt.
    - **Text based input**: Enter the prompt text in the text area.

**Output**

This response is saved in the `output.png` file.

    ]]></help>
    <citations>
        <citation type="bibtex">
            @misc{flux,
                author = {black forest labs},
                title = {FLUX github repository},
                howpublished = {\url{https://github.com/black-forest-labs/flux}},
                year = {2024},
                note = {Accessed: 2024-09-04}
            }
        </citation>
    </citations>
</tool>