adarshnagrikar14 / studio-ai

The model transforms real-life image to Ghibli Style Art Images.

  • Public
  • 2.2K runs

Studio AI Image Generator (FLUX.1-schnell + Ghibli LoRA)

This model uses the powerful black-forest-labs/FLUX.1-schnell foundation combined with a custom LoRA (studio.safetensors) to generate images, primarily focused on achieving a “Studio Ghibli” art style.

It can generate images based on a text prompt and optionally use a spatial control image to influence the composition.

Inputs

The model accepts the following inputs:

  • prompt (string): The text prompt describing the desired image.
  • spatial_img (file): An optional image file used for spatial control. The composition or elements of this image can influence the output.
  • height (integer, default=768): The height of the generated image in pixels.
  • width (integer, default=768): The width of the generated image in pixels.
  • seed (integer, default=42): The random seed for reproducibility. Use -1 for a random seed.
  • control_type (string, default="Ghibli", choices=["Ghibli", "None"]): Determines whether to apply the custom “Ghibli” style LoRA. Select “None” to use the base FLUX.1-schnell model without the style LoRA.
  • lora_scale (number, default=1.0, min=0.0, max=2.0): Controls the intensity of the applied LoRA when control_type is set to “Ghibli”. Higher values increase the LoRA’s influence.

Outputs

The model outputs a single generated image file.

Examples

Using the Python Client

import replicate
import os

# Make sure your Replicate API token is set as an environment variable
# os.environ["REPLICATE_API_TOKEN"] = "r8_..."

output = replicate.run(
    "adarshnagrikar14/studio-ai:latest", # Replace with the actual version hash if needed
    input={
        "prompt": "A cozy cabin in a lush green forest, river flowing nearby, Studio Ghibli style",
        "control_type": "Ghibli",
        "lora_scale": 1.0,
        "width": 768,
        "height": 768,
        "seed": 12345
        # "spatial_img": open("path/to/your/control_image.png", "rb") # Uncomment to use a spatial image
    }
)

# output is a URL to the generated image
print(output)
# Example output: ['https://pbxt.replicate.delivery/qA8.../output.png']

# You can then download the image from the URL

Using cURL (HTTP API)

First, get your API token from Replicate and set it as an environment variable:

export REPLICATE_API_TOKEN=r8_...

Then, make a prediction request:

curl -s -X POST \
  -H "Authorization: Bearer $REPLICATE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "version": "YOUR_MODEL_VERSION_HASH", # Get this from your model page on Replicate
    "input": {
      "prompt": "A majestic dragon flying over a floating island, Studio Ghibli style",
      "control_type": "Ghibli",
      "lora_scale": 1.1,
      "seed": 54321
      # Add other parameters like width, height, spatial_img (as URL) if needed
    }
  }' \
  https://api.replicate.com/v1/predictions

This will return a JSON response with a prediction ID. You can poll the status using the URL provided in the response’s urls.get field until it’s completed. The final result will contain the URL to the output image.

Notes

  • The studio.safetensors LoRA was trained to impart a style reminiscent of Studio Ghibli films. Experiment with lora_scale for different style intensities.
  • Using a spatial_img can significantly guide the output but might require prompt adjustments for best results.