LORA Qwen-Image example

Lora for Qwen-Image

No trigger word required

πŸ§ͺ Usage


πŸ”§ Initialization

from diffusers import DiffusionPipeline
import torch

model_name = "Qwen/Qwen-Image"

# Load the pipeline
if torch.cuda.is_available():
    torch_dtype = torch.bfloat16
    device = "cuda"
else:
    torch_dtype = torch.float32
    device = "cpu"

pipe = DiffusionPipeline.from_pretrained(model_name, torch_dtype=torch_dtype)
pipe = pipe.to(device)

πŸ”Œ Load LoRA Weights

# Load LoRA weights
pipe.load_lora_weights('flymy_realism.safetensors', adapter_name="lora")

🎨 Generate Image with lora trained on person

prompt = '''Super Realism portrait of a teenager woman of African descent, serene calmness, arms crossed, illuminated by dramatic studio lighting, sunlit park in the background, adorned with delicate jewelry, three-quarter view, sun-kissed skin with natural imperfections, loose shoulder-length curls, slightly squinting eyes, environmental street portrait with text "FLYMY AI" on t-shirt.'''
negative_prompt =  " "
image = pipe(
    prompt=prompt,
    negative_prompt=negative_prompt,
    width=1024,
    height=1024,
    num_inference_steps=50,
    true_cfg_scale=5,
    generator=torch.Generator(device="cuda").manual_seed(346346)
)

# Display the image (in Jupyter or save to file)
image.show()
# or
image.save("output.png")

πŸ–ΌοΈ Sample Output

Sample Output

πŸŽ›οΈ Using with ComfyUI

We provide a ready-to-use ComfyUI workflow that works with our trained LoRA models. Follow these steps to set up and use the workflow:

Setup Instructions

  1. Download the latest ComfyUI:

  2. Install ComfyUI:

    • Follow the installation instructions from the ComfyUI repository
    • Make sure all dependencies are properly installed
  3. Download Qwen-Image model weights:

  4. Place Qwen-Image weights in ComfyUI:

    • Copy the downloaded Qwen-Image model files to the appropriate folders in ComfyUI/models/
    • Follow the folder structure as specified in the model repository
  5. Download our pre-trained LoRA weights:

  6. Place LoRA weights in ComfyUI:

    • Copy the LoRA file flymy-ai/qwen-image-lora/pytorch_lora_weights.safetensors to ComfyUI/models/loras/
  7. Load the workflow:

    • Open ComfyUI in your browser
    • Load the workflow file qwen_image_lora_example.json located in this repository
    • The workflow is pre-configured to work with our LoRA models

Workflow Features

  • βœ… Pre-configured for Qwen-Image + LoRA inference
  • βœ… Optimized settings for best quality output
  • βœ… Easy prompt and parameter adjustment
  • βœ… Compatible with all our trained LoRA models

The ComfyUI workflow provides a user-friendly interface for generating images with our trained LoRA models without needing to write Python code.

πŸ–ΌοΈ Workflow Screenshot

ComfyUI Workflow

🀝 Support

If you have questions or suggestions, join our community:

⭐ Don't forget to star the repository if you like it!


license: apache-2.0

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for flymy-ai/qwen-image-realism-lora

Base model

Qwen/Qwen-Image
Adapter
(24)
this model

Spaces using flymy-ai/qwen-image-realism-lora 2