Instructions to use lsmpp/kontextrefiner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use lsmpp/kontextrefiner with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("lsmpp/kontextrefiner", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
| name: Update Diffusers metadata | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - update_diffusers_metadata* | |
| jobs: | |
| update_metadata: | |
| runs-on: ubuntu-22.04 | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup environment | |
| run: | | |
| pip install --upgrade pip | |
| pip install datasets pandas | |
| pip install .[torch] | |
| - name: Update metadata | |
| env: | |
| HF_TOKEN: ${{ secrets.SAYAK_HF_TOKEN }} | |
| run: | | |
| python utils/update_metadata.py --commit_sha ${{ github.sha }} | |