# Reimagine - Structure Reference The endpoint in Bria’s API allows guiding image generation not just with prompts but also by using an input image. This feature retains the original structure and depth of the input while incorporating new materials, colors, and textures to create fresh visuals. ### Key Benefits - : Use a reference image to replicate its outline and depth, reducing the need for complex prompts and minimizing trial and error. - : - Convert illustrations, sketches, or photos into new illustrative outputs. - Transform photos into variations that maintain the original layout. - : Control how much the input image's structure impacts the output on a scale from 0 to 1, allowing for diverse creative results. - : Ensures the output maintains the reference image's aspect ratio for layout consistency. The output resolution is approximately 1 megapixel. - : Combine structural references with tailored models to include unique IP characteristics in the generated outputs. ### Potential Use Cases Empower creative platforms and editing tools with advanced levels of control and flexibility for generating visual content. - Structure reference image Generated Visual (combined into a gif) - Structure reference image prompt: A watercolor painting of a lively urban street featuring a red vintage car parked in front of multi-story buildings, where soft, fluid brushstrokes capture the subtle gradients in the building facades, with warm earth tones blending into cool blues and grays for the shadows, giving the scene a nostalgic and dreamy atmosphere. structure_ref_influence: 0.75 Generated Visual - Structure reference image prompt: A ginger kitten sits on a textured beige surface, surrounded by soft balls of yarn. structure_ref_influence: 0.75 Generated Visual - Structure reference image prompt: curled orange peel. structure_ref_influence: 0.1 Generated Visual - : Maintain the structure and detail of assets while updating textures and colors for fresh looks without altering the original shape or layout. - : Simplifies design iteration for gaming assets, enabling rapid exploration and refinement. - : Transform marketing visuals while preserving their composition, adding new styles and elements with structural guidance. - : Repurpose user-generated content for marketing campaigns, making it fit seamlessly with brand aesthetics. This API endpoint supports content moderation via an optional parameter that can prevent generation if input images contain inappropriate content, and filters out unsafe generated images - the first blocked input image will fail the entire request. Endpoint: POST /reimagine ## Header parameters: - `api_token` (string, required) ## Request fields (application/json): - `structure_image_url` (string) A publicly available URL of the structure reference image. If both structure_image_url and structure_image_file are provided, structure_image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. - `structure_image_file` (string) The image file containing the structure reference, in base64 format. This parameter is used if structure_image_url is not provided. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. - `structure_ref_influence` (number) The influence of the structure reference on the generated image. This parameter is optional. Higher value means more adherence to the reference structure. - `prompt` (string) The text prompt describing the desired output image. - `num_results` (integer) How many images you would like to generate. This parameter is optional. When fast=false, only num_results=1 is supported. - `sync` (boolean) Determines the response mode. When true, responses are synchronous. With false, responses are asynchronous, immediately providing URLs for images that are generated in the background. Use polling for the URLs to retrieve images once ready. This parameter is optional. When fast=false, it is recommended to use sync=false. - `fast` (boolean) Determines the generation mode. When true, the generation will utilize the fast mode which provides the best balance between speed and quality. When false, the regular mode will be utilized. At the moment, tailored models trained using the 'Max' training version, do not support this paramter. - `seed` (integer) You can choose whether you want your generated result to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response with the prompt and other parameters. This parameter is optional. - `enhance_image` (boolean) When set to true, generates images with richer details, sharper textures, and enhanced clarity. Slightly increases generation time per image. - `prompt_content_moderation` (boolean) When enabled (default: true), the input prompt is scanned for NSFW or ethically restricted terms before image generation. If the prompt violates Bria's ethical guidelines, the request will be rejected with a 408 error. - `content_moderation` (boolean) When enabled, applies content moderation to both input visuals and generated outputs. For input images: - Processing stops at the first image that fails moderation - Returns a 422 error with details about which parameter failed For synchronous requests (sync=true): - If all generated images fail moderation, returns a 422 error - If some images pass and others fail, returns a 200 response with successful generations and "blocked" objects for failed ones For asynchronous requests (sync=false): - Failed images are replaced with zero-byte files at their placeholder URLs - Successful images are stored at their original placeholder URLs - `ip_signal` (boolean) Flags prompts with potential IP content. If detected, a warning will be included in the response. - `tailored_model_id` (string) The ID of the tailored model to use for generation. This parameter is optional. - `tailored_model_influence` (number) The influence of the tailored model on the generation. Only relevant if tailored_model_id is provided. This parameter is optional. When the training data was minimal or less diverse, lower the influence to improve flexibility in the results. - `include_generation_prefix` (boolean) This is relevant only when a tailored model is being used. When true, the model's generation prefix is automatically prepended to your prompt to maintain consistency with the training data, while false allows you to override the training prefix and write the complete prompt yourself, including any preferred prefix text. - `steps_num` (integer) The number of iterations the model goes through to refine the generated image. This parameter is optional. When fast=false, or for tailored models trained using the 'Max' training version, the default value is 30, the minimum is 20 and the maximum is 50. ## Response 209 fields (application/json): - `result` (array) There are multiple objects in this array (based on the amount specified in num_results) and each object represents a single image or a blocked result.