Recraft 20B
recraft-20b
Recraft is a model designed for generating images quickly and affordably.
Model Information
Input
Configure model parameters
Output
View generated results
Result
Preview, share or download your results with a single click.

Prerequisites
- Create an API Key from the Eachlabs Console
- Install the required dependencies for your chosen language (e.g., requests for Python)
API Integration Steps
1. Create a Prediction
Send a POST request to create a new prediction. This will return a prediction ID that you'll use to check the result. The request should include your model inputs and API key.
import requestsimport timeAPI_KEY = "YOUR_API_KEY" # Replace with your API keyHEADERS = {"X-API-Key": API_KEY,"Content-Type": "application/json"}def create_prediction():response = requests.post("https://api.eachlabs.ai/v1/prediction/",headers=HEADERS,json={"model": "recraft-20b","version": "0.0.1","input": {"size": "1024x1024","style": "realistic_image","prompt": "your prompt here"}})prediction = response.json()if prediction["status"] != "success":raise Exception(f"Prediction failed: {prediction}")return prediction["predictionID"]
2. Get Prediction Result
Poll the prediction endpoint with the prediction ID until the result is ready. The API uses long-polling, so you'll need to repeatedly check until you receive a success status.
def get_prediction(prediction_id):while True:result = requests.get(f"https://api.eachlabs.ai/v1/prediction/{prediction_id}",headers=HEADERS).json()if result["status"] == "success":return resultelif result["status"] == "error":raise Exception(f"Prediction failed: {result}")time.sleep(1) # Wait before polling again
3. Complete Example
Here's a complete example that puts it all together, including error handling and result processing. This shows how to create a prediction and wait for the result in a production environment.
try:# Create predictionprediction_id = create_prediction()print(f"Prediction created: {prediction_id}")# Get resultresult = get_prediction(prediction_id)print(f"Output URL: {result['output']}")print(f"Processing time: {result['metrics']['predict_time']}s")except Exception as e:print(f"Error: {e}")
Additional Information
- The API uses a two-step process: create prediction and poll for results
- Response time: ~6 seconds
- Rate limit: 60 requests/minute
- Concurrent requests: 10 maximum
- Use long-polling to check prediction status until completion
Overview
Reacraft 20B is designed to generate creative outputs based on user-provided prompts. It utilizes predefined parameters such as size, style, and prompt to customize the generated results, offering flexibility and creative possibilities for users. The model aims to provide high-quality and contextually accurate outputs that meet diverse user requirements.
Technical Specifications
Performance: Reacraft 20B balances speed and quality by providing quick previews at smaller sizes while offering detailed renderings for larger outputs.
Customizability
- Users can experiment with combinations of sizes, styles, and prompts to produce unique and varied results.
- Flexible input settings meet a variety of creative needs, from simple to highly complex designs.
Key Considerations
Prompt Specificity:
A well-written prompt is crucial for achieving desired results. Avoid vague terms and focus on actionable keywords.
Style Compatibility:
Not all styles will work equally well with all prompts. Experiment with styles to find the most visually compelling option.
Balance Between Inputs:
The interplay between size, style, and prompt significantly impacts the output. Ensure all parameters align with your creative goals.
Legal Information for Recraft 20B
By using this model, you agree to:
Tips & Tricks
Optimizing size:
- Use smaller resolutions (size) for quick previews and drafts.
- Opt for larger resolutions when you require high-detail outputs, such as final renderings or print-ready designs.
Choosing the Right style:
- Experiment with various styles to understand their effects on the output.
- If the output seems off, try switching to a simpler or more neutral style before refining further.
Crafting Effective prompts:
- Be descriptive and intentional: Instead of “A landscape,” write “A serene mountain landscape at sunrise with mist.”
- Focus on key elements and avoid redundant or overly abstract descriptions.
Iterative Refinement:
- Start with a broad prompt and gradually add details based on the output.
- Adjust one parameter at a time to identify the best configuration.
Document Successful Configurations:
- Keep track of input combinations that yield desirable results for future reference.
Realistic Image Styles
These styles focus on creating highly detailed, lifelike images. Choose these for a more authentic look, especially for realistic portraits or landscapes.
- realistic_image: Use this general realistic style for photorealistic depictions.
- realistic_image/b_and_w: For black-and-white photos, this option creates realistic images with a classic monochrome appearance.
- realistic_image/enterprise: Ideal for professional, clean shots, often used in business or high-end product photography.
- realistic_image/hard_flash: A style with high contrast, resembling images taken with a flash. Great for emphasizing details and creating sharp images.
- realistic_image/hdr: Perfect for high dynamic range (HDR) imagery, adding contrast and brightness for a more vivid and detailed picture.
- realistic_image/motion_blur: Choose this for a sense of motion or action. It introduces blurred motion effects to the image.
- realistic_image/natural_light: Ideal for soft and balanced lighting, simulating natural daylight. Great for portraits or outdoor scenes.
- realistic_image/studio_portrait: A style focusing on professional studio photography, with controlled lighting and clear focus on the subject.
Digital Illustration Styles
These styles are perfect for artistic or animated effects. They give a creative twist to the image, often used for posters, games, or digital art.
- digital_illustration: A basic digital illustration style that gives the image an overall artistic and stylized appearance.
- digital_illustration/2d_art_poster: Choose this for a 2D art look, often used for posters or creative illustrations.
- digital_illustration/2d_art_poster_2: Similar to the previous option, but it may offer slight differences in terms of color palette or design elements.
- digital_illustration/3d: Ideal for three-dimensional digital art, providing depth and perspective, often used for character or scene modeling.
- digital_illustration/80s: A style inspired by the 1980s aesthetic, typically with bright neon colors and retro designs.
- digital_illustration/engraving_color: This style resembles an engraving with colorful details, perfect for vintage and artistic designs.
- digital_illustration/glow: Adds a glowing effect around objects or characters, ideal for futuristic or vibrant designs.
- digital_illustration/grain: Introduces a textured, grainy effect, giving a retro or vintage feel to the image.
- digital_illustration/hand_drawn: Makes the image look like a traditional hand-drawn sketch, great for artistic representations.
- digital_illustration/hand_drawn_outline: Similar to the hand-drawn style but focuses more on outlines, ideal for comic or minimalist art.
- digital_illustration/handmade_3d: A handmade 3D effect, giving the illustration a crafted, organic feel.
- digital_illustration/infantile_sketch: For a childish or sketch-like aesthetic, giving the image a lighthearted or playful touch.
- digital_illustration/kawaii: This style focuses on the Japanese "cute" aesthetic, ideal for colorful, cute, and cartoon-like designs.
- digital_illustration/pixel_art: A retro pixelated effect, perfect for 8-bit or 16-bit style artwork.
- digital_illustration/psychedelic: For vibrant, surreal, and often abstract designs that evoke a sense of psychedelic art.
- digital_illustration/seamless: This option creates seamless patterns, useful for background designs or wallpaper-type illustrations.
- digital_illustration/voxel: This style generates 3D voxel-based designs, similar to blocky, Minecraft-like imagery.
- digital_illustration/watercolor: For a soft and flowing watercolor look, perfect for natural scenes or artistic compositions.
Realistic Images: If you want photorealistic results, stick to the "realistic_image" styles. Adjust the sub-styles (such as "hdr" or "natural_light") based on the mood you want to create. For example, use natural_light for a soft, daylight effect or hdr for a vibrant, high-contrast look.
Creative / Illustrative Styles: If you're aiming for creative, artistic outputs, choose from the digital_illustration substyles. For a retro, 80s aesthetic, try 80s; for a cute, Japanese-inspired look, kawaii is a great choice. The grain option can add a nostalgic or textured effect to your images.
Motion and Energy: If your goal is to create dynamic images with a sense of motion, use motion_blur for action shots or hard_flash for high contrast with sharp detail.
Combining Styles: You can experiment with combining realistic and illustrative styles for a unique mix. For example, use realistic_image for the base and apply a digital_illustration/glow for an artistic, futuristic vibe.
Capabilities
Creating visual assets for personal or professional use.
Exploring artistic styles through custom inputs.
Generating high-quality outputs tailored to specific prompts and resolutions.
What can I use for?
Designing concept art, illustrations, or creative projects.
Experimenting with visual aesthetics and styles.
Drafting visual ideas quickly and refining them iteratively.
Things to be aware of
Style Experiments:
- Explore how different styles interact with identical prompts.
- Test unconventional styles to achieve unique results.
Resolution Comparison:
- Generate the same prompt in multiple resolutions (size) to compare detail and processing speed.
Detailed Prompts:
- Try adding extra layers of specificity to prompts, such as environmental details, lighting conditions, or color schemes.
Combination Testing:
- Use similar prompts with different styles and resolutions to explore how they influence the final output.
Limitations
Overly complex prompts or mismatched styles may produce inconsistent results.
Higher resolution (size) settings may increase processing times.
Output Format: WEBP